Closed bidoubiwa closed 2 years ago
Hello!
I'm new to this and am also trying to get this working with Vue3 - I can see that the search is working, and I'm getting results back from my server, but I'm having issues rendering the results.
I've tried a few varients of the following without any luck:
<template>
<ais-instant-search :search-client="searchClient" index-name="users">
<ais-search-box />
<ais-hits>
<template v-slot="item">
<ais-highlight :hit="item" attribute="name" />
</template>
</ais-hits>
</ais-instant-search>
</template>
<script>
import {instantMeiliSearch} from '@meilisearch/instant-meilisearch';
import InstantSearch from "vue-instantsearch/vue3/es/src/components/InstantSearch";
import AisInstantSearch from "vue-instantsearch/vue3/es/src/components/InstantSearch";
import AisSearchBox from "vue-instantsearch/vue3/es/src/components/SearchBox.vue";
import AisHits from "vue-instantsearch/vue3/es/src/components/Hits.vue";
import AisHighlight from "vue-instantsearch/vue3/es/src/components/Highlight.vue";
export default {
name: 'search',
components: {
AisInstantSearch,
AisSearchBox,
AisHighlight,
AisHits,
},
data() {
return {
searchClient: instantMeiliSearch(
"my.server.address"
),
};
}
}
</script>
Thanks!
for the record - needed to dig one level deeper
<ais-hits>
<template v-slot="item">
<ais-highlight :hit="item.item" attribute="name" />
</template>
</ais-hits>
Oh! Does it work now ?
fixed by #195
@bidoubiwa https://codesandbox.io/s/ms-vue3-is-0293zk?file=/src/App.vue
When you type in search fast, it won't work it will backspace, i'm facing that issue even in vue 2, any idea what's causing it?
Yes! Unfortunately it comes from instantsearch-vue itself :/ see this issue https://github.com/meilisearch/instant-meilisearch/issues/644
I'm trying to showcase an example on how to work with
Vue 3
. Unfortunately I'm not able to make it work. The following example is based on the quick start guide of Meilisearch.The following code is where I stopped. The error throwns are as follow:
Vue 3
Working Vue 2