For vue2 projects, use @94ai/common-ui
LLMs.md

nf-popup-lazy-select ​

Popover-hosted asynchronous select with a custom trigger, optional assignment, close-on-select, selected object callbacks and manual visibility control.

Examples ​

Multiple / single / close / assign ​

Loading example…
Multiple / single / close / assign

Echo ​

Loading example…
Echo

Props ​

Descriptions preserve common-ui semantics; defaults and signatures follow the current Vue 3 implementation. Compatibility props do not enable unsupported legacy rendering.

AttributeDescriptionTypeValuesDefault
modelValue / v-model (value)Bound value; value remains compatible; prefer v-model in Vue 3SelectModelValue—undefined
tagCustom rendering tag; div or custom-select-dropdown displays an inline liststring | Component—'custom-select-dropdown'
popdownOnSelectClose popup on selection in single modeboolean—false
assignmentOnSelectUpdate bound value on selection; false still reports clicked itemboolean—true
emitSelectedItemOnClickget-selected-data returns values by default; true returns full recordsboolean—false
visibleChangeKeywordCachedPreserve keyword across closing and reopeningboolean—true
visibleChangeSelectListCachedPreserve searched list across closing and reopeningboolean—true
keyValueFields used for option label and value[string, string]—['label', 'value']
virtualListEnable virtual scrollingboolean—false
dataKeyUnique virtual row key: field name or functionstring | ((row: SelectOption) => string | number)—'templateId'
itemOptionsConfigure list properties and events together; event names accept kebab-case or camelCaseRecord<string, unknown>—{}
dataComponentCustom option component receiving source, index and extraPropsComponent—undefined
estimateSizeEstimated row height in pxnumber—34
keepsMinimum inline virtual window; dropdown virtualization is managed by SelectV2number—30
requestPaginated request returning records and total record count; parameters and context belowLazySelectRequest—undefined
initListLoad initially; false defers loading until focusboolean—true
pageSizeNumber of records per requestnumber—10
keywordAliasRequest field for search keywordstring—'keyword'
pageNoAliasRequest field for page numberstring—'pageNo'
pageSizeAliasRequest field for page sizestring—'pageSize'
valueAliasInitial request field for selected valuesstring—'value'
loadingDescLoading messagestring—Locale configuration
heightScrollable list heightstring—'245px'
widthSelector widthstring—'100%'
maxWidthMaximum selector widthstring—undefined
showTipShow option tooltipboolean—true
multipleEnable multiple selectionboolean—false
disabledDisable interactionboolean—Inherited configuration
sizeInput size; mini / medium map to small / defaultSelectSizesmall / default / large / mini / medium'mini'
collapseTagsCollapse selected tags in multiple modeboolean—multiple
multipleLimitMaximum selected items; 0 means unlimitednumber—0
placeholderInput placeholderstring—Locale configuration
noDataTextEmpty list text; can use the empty slotstring—Locale configuration
popperClassDropdown CSS classstring—undefined
startInitial inline scroll indexnumber—0
offsetInitial inline scroll offset in pxnumber—0
directionCompatibility field; currently has no effectStringverticalundefined
pageModeCompatibility field; currently has no effectboolean—undefined
topThresholdTop threshold for totop; may fire repeatedlynumber—0
bottomThresholdBottom threshold for tobottom; may fire repeatedlynumber—0
rootTagInline list root tagString—'div'
wrapTagInline list wrapper tagString—'div'
wrapClassCompatibility field; currently has no effectString—undefined
wrapStyleInline list wrapper styleCSSProperties—undefined
itemTagInline row wrapper tagString—'div'
itemClassInline row CSS classString—undefined
itemClassAddExtra row class function (index, row)(index: number, row: SelectOption) => string—undefined
itemStyleInline row styleCSSProperties—undefined
itemScopedSlotsCompatibility field; currently has no effectObject—undefined
headerTagCompatibility field; currently has no effectString—undefined
headerClassCompatibility field; currently has no effectString—undefined
headerStyleCompatibility field; currently has no effectCSSProperties—undefined
footerTagCompatibility field; currently has no effectString—undefined
footerClassCompatibility field; currently has no effectString—undefined
footerStyleCompatibility field; currently has no effectCSSProperties—undefined
optionsList of selectable optionsSelectOption[]—[]
selectAllShow select-all controlboolean—false
selectAllTextSelect-all labelstring—Locale configuration
clearableShow the clear selection controlboolean—true
reserveKeywordKeep the search keyword after selectionboolean—true
filterableEnable searchingboolean—true
filterMethodCustom filtering function(query: string) => void | Promise<void>—undefined
remoteUse remote filteringboolean—false
loadingLoading stateboolean—false
popperAppendToBodyTeleport dropdown to body; maps to Element Plus teleportedboolean—true
defaultFirstOptionSelect the first match on Enterboolean—false
allowCreateAllow new options; requires filterableboolean—false
automaticDropdownOpen non-filterable select on focusboolean—false
nameNative input namestring—undefined
keywordHighlightHighlight search keywordboolean—true
keywordLabelAliasCompatibility field; highlighting uses text nodes, without HTML injectionstring—'keywordHighlightLabel'
echoValueTopMove selected rows to top in virtual listboolean—true
extraPropsExtra props passed to custom option componentRecord<string, unknown>—undefined
headeClassCompatibility field; currently has no effectstring—undefined
beforeVisibleChangePost-visibility hook; return break to skip subsequent internal handling(visible: boolean) => void | "break" | "discard-cache" | Promise<void | "break" | "discard-cache">—undefined
placementDropdown placementSelectProps["placement"]—undefined
initListAssigmentValueCompatibility prop; initial data does not overwrite the bound valueboolean—false
noDataImgShow NfEmpty when no databoolean—false
allowEmptySearchAllow requests with an empty keywordboolean—true
popupWidthPopup widthnumber | string—200
popupClassPopup CSS classstring—undefined
popupTitlePopup titlestring—undefined
popupDisabledDisable popupboolean—false
popupOffsetPopup offsetnumber—0
popupPlacementPopup placementPopoverProps["placement"]—'bottom'
popupTriggerPopup triggerstringclick / hover / focus / manual'click'
popupTransitionPopup transition namestring—undefined
popupVisibleArrowShow popup arrowboolean—true
popupOptionsOptions passed to Popperobject—undefined
popupOpenDelayPopup open delay in msnumber—undefined
popupCloseDelayPopup close delay in msnumber—200
popupTabindexPopup trigger tabindexnumber—0

request(params, context) accepts a synchronous result or Promise. params uses the aliases above for page, page size and keyword; initial echo also includes selected values (including 0 / false). context.data is the normalized list, originData the raw records and allCachedDataList the instance cache. Return total as record count, not page count. In fetch-data, current is the current page; records is the raw response, data the accumulated normalized list and originData the accumulated raw list.

ts
type RequestParams = Record<string, string | number | boolean | (string | number | boolean)[] | undefined>
interface RequestContext {
  data: SelectOption[]
  originData: SelectOption[]
  allCachedDataList: SelectOption[]
}
type RequestResult = { records: SelectOption[]; total: number }
type LazySelectRequest = (params: RequestParams, context: RequestContext) => RequestResult | Promise<RequestResult>
interface FetchCallBackData {
  total: number
  current: number
  hasMore: boolean
  keyword: string
  records: SelectOption[]
  data: SelectOption[]
  originData: SelectOption[]
  allCachedDataList: SelectOption[]
}

Events ​

EventDescriptionArguments
update:modelValueSelection changed; update v-model(value: SelectModelValue)
update:valueSelection changed; compatibility event(value: SelectModelValue)
inputSelection changed; compatibility event(value: SelectModelValue)
changeFires when selection changes(value: SelectModelValue)
focusInput gains focus(event: FocusEvent)
blurInput loses focus(event: FocusEvent)
clearClear control activated()
remove-tagTag removed in multiple mode(value: SelectValue)
visible-changeDropdown shown: true; hidden: false(visible: boolean)
select-itemOption clicked; returns its value(value: SelectValue)
scrollList scroll; Event only, without the old range argument(event: Event)
totopList reaches top threshold(event?: Event)
tobottomList reaches bottom threshold(event?: Event)
resizedList viewport measurement(id: string | number, size: number)
fetch-dataAfter each successful request(data: FetchCallBackData)
fetch-errorRequest failed(error: unknown)
get-selected-dataSelection data; emitSelectedItemOnClick chooses values or full records(valueOrRows: SelectModelValue | SelectOption | (SelectOption | undefined)[])
popup-showPopup starts showing; true(visible: true)
popup-hidePopup starts hiding; false(visible: false)
popup-after-enterShow transition finished; no arguments()
popup-after-leaveHide transition finished; no arguments()

Slots ​

SlotDescriptionScope
defaultPopup trigger/reference element—
optionCustom option content{ row: SelectOption, item: SelectOption, index: number }
headerList header—
footerList footer—
prefixInput prefix—
emptyEmpty option list content—
loadingCustom loading state—
tagCustom selected tagsElement Plus tag slot props

Exposed methods and state ​

  • currentVal
  • popup
  • popLazySelectRef
  • dataList
  • dataMap
  • allCachedDataList

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.

request(params, context) returns { records, total }. Stale requests cannot overwrite the current search. fetch-error reports failures; retry the same page. allCachedDataMap / dataMap are typed Maps.