1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-13 20:39:58 +00:00
elk/pages/[[server]]/search.vue
Joaquín Sánchez 36004a7eba
feat: bump to latest vue 3.4.19 (#2607)
Co-authored-by: patak <matias.capeletto@gmail.com>
2024-02-24 12:24:21 +00:00

32 lines
740 B
Vue

<script setup lang="ts">
const { t } = useI18n()
useHydratedHead({
title: () => t('nav.search'),
})
const search = ref<{ input?: HTMLInputElement }>()
watchEffect(() => {
if (search.value?.input)
search.value?.input?.focus()
})
onActivated(() =>
search.value?.input?.focus(),
)
onDeactivated(() => search.value?.input?.blur())
</script>
<template>
<MainContent>
<template #title>
<NuxtLink to="/search" timeline-title-style flex items-center gap-2 @click="$scrollToTop">
<div i-ri:search-line class="rtl-flip" />
<span>{{ $t('nav.search') }}</span>
</NuxtLink>
</template>
<div px2 mt3>
<SearchWidget v-if="isHydrated" ref="search" m-1 />
</div>
</MainContent>
</template>