API Reference

Props

The input element to bind with. Can be a select or reference to Element / Component.

data

Array

The local auto-complete query data.

item-key

String

Value of each data[key] to show, leave blank to use the data object.

append-to-body

Boolean

false

Append the typeahead dropdown to body.

ignore-case

Boolean

true

Ignore input case while matching. Only work in local data mode.

match-start

Boolean

false

Match from the head of item. Only work in local data mode.

force-select

Boolean

false

Force user to select from the options or the model will be empty.

force-clear

Boolean

false

Clear the input if no valid options has selected in force-select mode.

open-on-focus

Boolean

true

Open the typeahead dropdown on input focus.

open-on-empty

Boolean

false

Open the typeahead dropdown to show suggestions even if input is empty.

preselect

Boolean

true

Select the first item that matches the query automatically.

limit

Number

10

Limit the options size.

async-src

String

The ajax url to fetch data using GET method, query string will be append to the end of this prop value, should return JSON object or array.

async-key

String

The async JSON key to render, leave blank to use the original json object (should be Array).

async-function

Function

The custom async query function with 2 params: query as the user input, and done as the callback function with array data (note that async-key won't work with this). See the example in Custom Template section for details.

debounce

Number

200

Debounce the input for specify milliseconds while in async mode.

Slots

Name

Description

item

Use this scoped slot to override the typeahead item's template.

empty

(0.25.0+) Slot content will be displayed while no results matched (if the slot exist).