Skip to content
Star

PxAsyncSelect

A searchable select that emits a scrolling event when the user scrolls near the bottom of the dropdown, so you can load and append the next page yourself. It doesn't call any load-more function for you — hasMore and loading are display-only flags you control.

Usage

Demo
Scroll down to load more...
Selected: None
Total loaded: 3

Props

PropTypeDefaultDescription
modelValuestring | number | object | nullnullCurrently selected value. Use with v-model.
optionsunknown[][]Current page of loaded options.
hasMorebooleanfalseDisplay-only flag — doesn't change behavior, use it to decide whether to fetch more on @scrolling.
loadingbooleanfalseShows a loading state while true.
placeholderstring''Placeholder text.
labelstring'name'Property name read from each option for its display text.
reduce(option) => unknownundefinedValue extractor function.
disabledbooleanfalseDisables the select.
multiplebooleanfalseAllows selecting more than one option.
clearablebooleantrueShows a button to clear the current selection.

Emits

EventPayloadDescription
update:modelValueunknownEmitted on selection change.
scrollingEmitted (debounced) when the user scrolls near the bottom of the dropdown — this is your cue to load the next page.
searchstringEmitted with the current search query as the user types.
openEmitted when the dropdown opens.
selectunknownEmitted with the selected item.

Built with VitePress