Autocomplete
Selecting items in a list from a text input.
Import
js
import { MpAutocomplete } from '@mekari/pixel3'
Playground
API
MpAutocomplete
Props
Events
Slots
Name | Type | Default |
---|---|---|
id | string | - |
data | unknown[] | () => [] |
model-value | string | number | { [key: string]: unknown } | - |
default-is-open | boolean | false |
placeholder | string | - |
label-prop | string | value |
value-prop | string | value |
group-key | string | group |
content-attrs | { class?: unknown, style?: unknown, [key: string]: unknown } | - |
empty-text | string | No result found |
content-loading-text | string | Loading |
button-action-text | string | Button |
key-code | string[] | ["Enter"] |
is-read-only | boolean | false |
is-disabled | boolean | false |
is-invalid | boolean | false |
is-required | boolean | false |
is-full-width | boolean | true |
is-loading | boolean | false |
is-content-loading | boolean | false |
is-clearable | boolean | false |
is-searchable | boolean | false |
is-infinity-scroll | boolean | false |
is-manual-filter | boolean | false |
use-portal | boolean | false |
is-show-button-action | boolean | false |
is-group-suggestions | boolean | false |
is-raw-value | boolean | false |
is-keep-alive | boolean | true |
is-adaptive-width | boolean | true |
Data Prop
MpAutocomplete
support two different data formats:
An array of strings, use when do not need to customize item component. An array of objects with required value properties and any other additional properties.
vue
<mp-autocomplete :data="['Option 1', 'Option 2', 'Option 3']" />
vue
<mp-autocomplete
:data="[
{ value: 'Option 1', email: 'option1@mail.com' },
{ value: 'Option 2', email: 'option2@mail.com' },
{ value: 'Option 3', email: 'option3@mail.com' },
]"
/>