Skip to content

VfAjaxSelect

Simple select component that loads options from an async function.

Import

typescript
import { VfAjaxSelect } from '@zyno-io/vue-foundation';

Basic Usage

vue
<VfAjaxSelect
    v-model="selectedItem"
    :load-fn="() => api.getItems()"
    display-key="name"
    null-text="Select an item..."
    loading-text="Loading items..."
/>

Props

PropTypeDescription
modelValueTSelected value (v-model)
loadFn() => Promise<T[]>Async function returning options
displayKeykeyof TProperty to display for each option
preprocesor(option: T) => stringCustom display formatter
nullTextstringPlaceholder option text
loadingTextstringText shown while loading (default: 'Loading...')

Demo