Closed EmileSpecs closed 1 month ago
This is because the await request will be executed once when the server renders, if you put it in the function will not happen Missing search data
.
<script setup>
const search = ref("");
const results = ref([]);
const handleSearch = async () => {
results.value = await searchContent(search);
}
</script>
<template>
<main>
<input v-model="search" />
<button @click="handleSearch">search</button>
<pre>{{ results }} </pre>
</main>
</template>
However, he will have a strange warning that will ask you to replace 'searchContent' with '$fetch'
@sooooooooooooooooootheby thanks, that solved it.
Environment
Build Modules: -
Reproduction
https://github.com/EmileSpecs/nuxtcontentsearch
Describe the bug
Using the playground minimal example I added all the necessary setup steps to get search to work.
I however het the error:
Missing search data
Can't find any information about anyone having this issue and I don't see anything that I've missed configuring search.
Can someone please assist?
Thanks!
Additional context
No response
Logs
No response