-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.vue
36 lines (34 loc) · 909 Bytes
/
example.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<script setup>
import algoliasearch from 'algoliasearch/lite';
import { usePage } from '@inertiajs/vue3';
const page = usePage();
const algolia = page.props.algolia;
const searchClient = algoliasearch(
algolia.key,
...algolia.searchables
);
</script>
<template>
<section >
<ais-instant-search
:search-client="searchClient"
index-name="products"
>
<ais-configure
:hits-per-page.camel="4"
/>
<ais-search-box
placeholder="text"
/>
<div>
<ais-hits>
<template v-slot:item="{ item }">
<article>
{{ item.title }}
</article>
</template>
</ais-hits>
</div>
</ais-instant-search>
</section>
</template>