refactor to UI components

This commit is contained in:
2023-05-26 00:50:19 +02:00
parent 0f48494469
commit c76bf3f6d8
20 changed files with 160 additions and 78 deletions

View File

@@ -45,16 +45,11 @@ const handleKeypress = (event: { [key: string]: number }) => {
defineExpose({ handleKeypress })
</script>
<template>
<ul
tabindex="0"
class="menu rounded-md border-[1px] bg-base-100 p-2 text-[0.875rem] text-black shadow-md"
>
<li class="flex flex-row" @click="emit('createLink', props.autocompleteText)">
<a class="flex-grow px-2 py-1" :class="!activeResult && 'active'">
<span class="flex-grow">{{ props.autocompleteText }}</span>
<i class="fas fa-plus-circle ml-auto text-white" />
</a>
</li>
<UIMenu class="border-[1px] p-2 text-[0.875rem] text-black shadow-md" :compact="true">
<UIMenuItem :active="!activeResult" @click="emit('createLink', props.autocompleteText)">
<span class="flex-grow">{{ props.autocompleteText }}</span>
<i class="fas fa-plus-circle ml-auto text-white" />
</UIMenuItem>
<SearchResult
v-for="result in results"
:key="result.id"
@@ -62,5 +57,5 @@ defineExpose({ handleKeypress })
:active-result="activeResult"
@go-to-note="emit('createLink', result.title)"
/>
</ul>
</UIMenu>
</template>