PAsyncTypeahead fetches options asynchronously once the user types two or more characters. It uses a promise-based search function and returns the chosen object.
Demo
Usage
<PAsyncTypeahead
:promise-fun="fetchCustomers"
:selected-item="selectedCustomer"
@select="selectedCustomer = $event"
>
Customer
</PAsyncTypeahead>
methods: {
fetchCustomers(query) {
returnapi.searchCustomers(query);
},
}
Props
Prop
Type
Default
Notes
selectedItem
Object
null
Selected item object.
promiseFun
Function
—
Required. Must return a promise resolving to { id, label } objects.