ais-autocomplete
<ais-autocomplete // Optional parameters :escape-html="boolean" :class-names="object" />
1
2
3
4
5
6
7
8
9
import { AisAutocomplete } from 'vue-instantsearch';
// Use 'vue-instantsearch/vue3/es' for Vue 3
export default {
components: {
AisAutocomplete
},
// ...
};
1. Follow additional steps in Optimize build size to ensure your code is correctly bundled.
2. This imports all the widgets, even the ones you don’t use. Read the Getting started guide for more information.
About this widget
The ais-autocomplete
widget provides the logic to create a connected component that provides access to all indices of your InstantSearch instance.
To configure the number of hits to show, use the ais-hits-per-page
widget or the ais-configure
widget.
To retrieve results from multiple indices, use the ais-index
widget.
The Autocomplete library lets you build a full-featured, accessible search experience.
Examples
1
<ais-autocomplete />
Props
Parameter | Description | ||
---|---|---|---|
escape-html
|
type: boolean
default: true
Optional
Whether to escape HTML entities from hits string values. |
||
Copy
|
|||
class-names
|
type: object
default: {}
Optional
The CSS classes you can override:
|
||
Copy
|
Customize the UI
Parameter | Description | ||
---|---|---|---|
default
|
The slot to override the complete DOM output of the widget. Note that when you implement this slot, none of the other slots will change the output, as the default slot surrounds them. Scope
The indices contains their hits and results, and the main index in first position. You can leverage the highlighting feature of Algolia through the
|
||
Copy
|