nf-virtual-select
Standard/virtual select supporting single/multiple selection, select-all, aliases, keyword highlighting, comma-separated exact matches, remote filters, option slots and scroll methods.
Examples
Event and property configuration: method one
Event and property configuration: method two
Keyword highlighting
Props
Descriptions preserve common-ui semantics; defaults and signatures follow the current Vue 3 implementation. Compatibility props do not enable unsupported legacy rendering.
| Attribute | Description | Type | Values | Default |
|---|---|---|---|---|
modelValue / v-model (value) | Bound value; value remains compatible; prefer v-model in Vue 3 | SelectModelValue | — | undefined |
tag | Custom rendering tag; div or custom-select-dropdown displays an inline list | string | Component | — | 'el-select' |
keyValue | Fields used for option label and value | [string, string] | — | ['label', 'value'] |
options | List of selectable options | SelectOption[] | — | [] |
itemOptions | Configure list properties and events together; event names accept kebab-case or camelCase | Record<string, unknown> | — | {} |
virtualList | Enable virtual scrolling | boolean | — | false |
dataKey | Unique virtual row key: field name or function | string | ((row: SelectOption) => string | number) | — | 'templateId' |
dataComponent | Custom option component receiving source, index and extraProps | Component | — | undefined |
estimateSize | Estimated row height in px | number | — | 34 |
keeps | Minimum inline virtual window; dropdown virtualization is managed by SelectV2 | number | — | 30 |
height | Scrollable list height | string | — | '245px' |
width | Selector width | string | — | '100%' |
maxWidth | Maximum selector width | string | — | undefined |
showTip | Show option tooltip | boolean | — | true |
multiple | Enable multiple selection | boolean | — | false |
selectAll | Show select-all control | boolean | — | false |
keywordHighlight | Highlight search keyword | boolean | — | true |
keywordLabelAlias | Compatibility field; highlighting uses text nodes, without HTML injection | string | — | 'keywordHighlightLabel' |
disabled | Disable interaction | boolean | — | Inherited configuration |
size | Input size; mini / medium map to small / default | SelectSize | small / default / large / mini / medium | Inherited configuration |
clearable | Show the clear selection control | boolean | — | false |
collapseTags | Collapse selected tags in multiple mode | boolean | — | multiple |
multipleLimit | Maximum selected items; 0 means unlimited | number | — | 0 |
autocomplete | Input autocomplete attribute | string | — | 'off' |
placeholder | Input placeholder | string | — | Locale configuration |
loading | Loading state | boolean | — | false |
loadingText | Loading message | string | — | Locale configuration |
noMatchText | No-match text; can use the empty slot | string | — | Locale configuration |
noDataText | Empty list text; can use the empty slot | string | — | Locale configuration |
popperClass | Dropdown CSS class | string | — | undefined |
popperAppendToBody | Teleport dropdown to body; maps to Element Plus teleported | boolean | — | true |
start | Initial inline scroll index | number | — | 0 |
offset | Initial inline scroll offset in px | number | — | 0 |
direction | Compatibility field; currently has no effect | String | vertical | undefined |
pageMode | Compatibility field; currently has no effect | boolean | — | undefined |
topThreshold | Top threshold for totop; may fire repeatedly | number | — | 0 |
bottomThreshold | Bottom threshold for tobottom; may fire repeatedly | number | — | 0 |
rootTag | Inline list root tag | String | — | 'div' |
wrapTag | Inline list wrapper tag | String | — | 'div' |
wrapClass | Compatibility field; currently has no effect | String | — | undefined |
wrapStyle | Inline list wrapper style | CSSProperties | — | undefined |
itemTag | Inline row wrapper tag | String | — | 'div' |
itemClass | Inline row CSS class | String | — | undefined |
itemClassAdd | Extra row class function (index, row) | (index: number, row: SelectOption) => string | — | undefined |
itemStyle | Inline row style | CSSProperties | — | undefined |
itemScopedSlots | Compatibility field; currently has no effect | Object | — | undefined |
headerTag | Compatibility field; currently has no effect | String | — | undefined |
headerClass | Compatibility field; currently has no effect | String | — | undefined |
headerStyle | Compatibility field; currently has no effect | CSSProperties | — | undefined |
footerTag | Compatibility field; currently has no effect | String | — | undefined |
footerClass | Compatibility field; currently has no effect | String | — | undefined |
footerStyle | Compatibility field; currently has no effect | CSSProperties | — | undefined |
selectAllText | Select-all label | string | — | Locale configuration |
reserveKeyword | Keep the search keyword after selection | boolean | — | true |
filterable | Enable searching | boolean | — | false |
filterMethod | Custom filtering function | (query: string) => void | Promise<void> | — | undefined |
remote | Use remote filtering | boolean | — | false |
defaultFirstOption | Select the first match on Enter | boolean | — | false |
allowCreate | Allow new options; requires filterable | boolean | — | false |
automaticDropdown | Open non-filterable select on focus | boolean | — | false |
name | Native input name | string | — | undefined |
echoValueTop | Move selected rows to top in virtual list | boolean | — | true |
extraProps | Extra props passed to custom option component | Record<string, unknown> | — | undefined |
headeClass | Compatibility field; currently has no effect | string | — | undefined |
beforeVisibleChange | Post-visibility hook; return break to skip subsequent internal handling | (visible: boolean) => void | "break" | "discard-cache" | Promise<void | "break" | "discard-cache"> | — | undefined |
placement | Dropdown placement | SelectProps["placement"] | — | undefined |
Events
| Event | Description | Arguments |
|---|---|---|
update:modelValue | Selection changed; update v-model | (value: SelectModelValue) |
update:value | Selection changed; compatibility event | (value: SelectModelValue) |
input | Selection changed; compatibility event | (value: SelectModelValue) |
change | Fires when selection changes | (value: SelectModelValue) |
focus | Input gains focus | (event: FocusEvent) |
blur | Input loses focus | (event: FocusEvent) |
clear | Clear control activated | () |
remove-tag | Tag removed in multiple mode | (value: SelectValue) |
visible-change | Dropdown shown: true; hidden: false | (visible: boolean) |
select-item | Option clicked; returns its value | (value: SelectValue) |
scroll | List scroll; Event only, without the old range argument | (event: Event) |
totop | List reaches top threshold | (event?: Event) |
tobottom | List reaches bottom threshold | (event?: Event) |
resized | List viewport measurement | (id: string | number, size: number) |
Slots
| Slot | Description | Scope |
|---|---|---|
default | Below regular/inline list; use footer for virtual dropdown | — |
option | Custom option content | { row: SelectOption, item: SelectOption, index: number } |
header | List header | — |
footer | List footer | — |
prefix | Input prefix | — |
empty | Empty option list content | — |
loading | Custom loading state | — |
tag | Custom selected tags | Element Plus tag slot props |
Exposed methods and state
currentValnfVirtualSelectvirtualSelectListkeywordselectArroptionsListconfiginit()filterMethod(query)highLightFilterMethod(query)visibleChange(boolean)reset()scrollToBottom()scrollToIndex(index)scrollToOffset(offset)getSize()getClientSize()getScrollSize()updatePageModeFront()toggleCheckAll(boolean)focus()blur()
Migration notes
Vue 3 uses modelValue / update:modelValue; legacy value, update:value and input remain available on selection components. The implementation uses public Element Plus APIs, not Element UI internals. mini maps to small; medium maps to default.
virtualList uses fixed-height vertical SelectV2 rows. Legacy horizontal / pageMode behavior is not supported. Root/wrap/item customization applies to the inline list only; use the exposed methods instead of private Element UI refs.
