mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
docs(app): use UContentSearchButton component
This commit is contained in:
@@ -11,7 +11,6 @@ const { integrity, api } = runtimeConfig.public.content
|
||||
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation(), { default: () => [] })
|
||||
const { data: files } = await useLazyFetch<ContentSearchFile[]>(`${api.baseURL}/search${integrity ? '.' + integrity : ''}`, { default: () => [] })
|
||||
|
||||
const open = ref(false)
|
||||
const searchTerm = ref('')
|
||||
|
||||
// watch(searchTerm, debounce((query: string) => {
|
||||
@@ -55,7 +54,6 @@ useServerSeoMeta({
|
||||
twitterCard: 'summary_large_image'
|
||||
})
|
||||
|
||||
provide('open', open)
|
||||
provide('navigation', navigation)
|
||||
provide('files', files)
|
||||
</script>
|
||||
@@ -74,6 +72,6 @@ provide('files', files)
|
||||
|
||||
<Footer v-if="!route.path.startsWith('/examples')" />
|
||||
|
||||
<LazyUContentSearch v-model:open="open" v-model:search-term="searchTerm" :files="files" :navigation="navigation" :fuse="{ resultLimit: 42 }" />
|
||||
<LazyUContentSearch v-model:search-term="searchTerm" :files="files" :navigation="navigation" :fuse="{ resultLimit: 42 }" />
|
||||
</UApp>
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,6 @@ const props = defineProps<{
|
||||
const route = useRoute()
|
||||
const config = useRuntimeConfig().public
|
||||
|
||||
const open = inject<Ref<boolean>>('open')
|
||||
const navigation = inject<Ref<NavItem[]>>('navigation')
|
||||
|
||||
const items = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||
@@ -36,7 +35,7 @@ const items = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||
<!-- <ColorPicker /> -->
|
||||
|
||||
<UTooltip text="Search" :kbds="['meta', 'K']">
|
||||
<UButton aria-label="Search" icon="i-heroicons-magnifying-glass-20-solid" color="gray" variant="ghost" @click="open = true" />
|
||||
<UContentSearchButton />
|
||||
</UTooltip>
|
||||
|
||||
<!-- <UColorModeButton /> -->
|
||||
|
||||
Reference in New Issue
Block a user