Skip to content

Commit

Permalink
fix: run fetchFuseListData only on the client
Browse files Browse the repository at this point in the history
  • Loading branch information
WRXinYue committed Jan 5, 2025
1 parent 988d0dc commit 630bdd2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions theme/components/layouts/SakuraSearchLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
import { useFuseSearch } from 'valaxy'
import { ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { isClient } from '@vueuse/core'
const input = ref()
const { results, fetchFuseListData } = useFuseSearch(input)
const route = useRoute()
watch(() => route.query.q as string, (query) => {
fetchFuseListData()
if (isClient)
fetchFuseListData()
input.value = query || ''
}, { immediate: true })
</script>
Expand Down Expand Up @@ -61,7 +64,7 @@ watch(() => route.query.q as string, (query) => {

<div class="post-more">
<AppLink :to="result.item.link">
<MashiroDots class="float-right mt-10px" />
<SakuraDots class="float-right mt-10px" />
</AppLink>
</div>
<hr style="border-bottom: 1px #ccc; width: 30%;" class="mx-auto mb-62px mt-69px">
Expand Down

0 comments on commit 630bdd2

Please sign in to comment.