Skip to content

FaSelectPage

Combines keyword search, pagination and selected-label restoration inside the dropdown. requestApi follows the Fast PagedInput / PagedResult contract.

Select Page

View code
Vue
<template>
	<div class="demo-stack">
		<FaSelectPage
			v-model="value"
			v-model:label="label"
			:request-api="requestApi"
			clearable
			placeholder="搜索并翻页"
			style="max-width: 420px"
			@change="changedData = $event"
		/>
		<span class="demo-value">当前用户:{{ label ?? "未选择" }}({{ value ?? "—" }});change 数据:{{ JSON.stringify(changedData) }}</span>
	</div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import type { PagedInput, PagedResult } from "fast-element-plus";

const value = ref<number | null>(null);
const label = ref<string | null>(null);
const changedData = ref<unknown>();
const allRows = Array.from({ length: 36 }, (_, index) => ({ value: index + 1, label: `业务用户 ${String(index + 1).padStart(2, "0")}` }));

const requestApi = async (input?: PagedInput): Promise<PagedResult<Record<string, unknown>>> => {
	await new Promise<void>((resolve) => {
		window.setTimeout(resolve, 250);
	});
	const keyword = input?.searchValue?.toLowerCase() ?? "";
	const filtered = allRows.filter((item) => item.label.toLowerCase().includes(keyword));
	const pageIndex = input?.pageIndex ?? 1;
	const pageSize = input?.pageSize ?? 10;
	return {
		pageIndex,
		pageSize,
		totalRows: filtered.length,
		rows: filtered.slice((pageIndex - 1) * pageSize, pageIndex * pageSize),
	};
};
</script>

FaSelectPage Complete API

Props (57)

Fast and Element Plus 2.14.6 props are merged below. Fast changes appear first; native props that are not forwarded remain visible for compatibility review.

PropertySourceDescriptionTypeDefault
modelValueFast overridev-model value.String / Number / Boolean / Object / ArrayFastfalseELfalse
loadingFast overrideLoading state.BooleanFastfalseELfalse
popperClassFast overrideCustom dropdown-overlay class.String / Array / Object / BooleanFast""EL""
remoteFast overrideEnable remote search.BooleanFastfalseELfalse
propsFast overrideField mappings.ObjectFast{"label":"label","hide":"hide","disabled":"disabled","children":"children"}EL{"label":"label","value":"value","disabled":"disabled","options":"options"}
labelFast additionDisplay text or synchronized label.String / Array
widthFast additionComponent width.String / Number100%
moreDetailFast additionEnable wider option-detail layout.Booleanfalse
requestApiRequiredFast additionAsynchronous data-request function.Function
initParamFast additionInitial request parameters.String / Number / Object
nameEL nativeIcon name, CSS class, or external SVG URL.String
idEL nativeNative ID of the root input.String
autocompleteEL nativeNative input autocomplete attribute.Stringoff
automaticDropdownEL nativeOpen dropdown automatically on focus.Booleanfalse
sizeEL nativeComponent size.String
effectEL nativeTooltip theme for the dropdown.Stringlight
disabledEL nativeDisable the component or current option.Booleanfalse
clearableEL nativeAllow clearing.Booleanfalse
filterableEL nativeAllow filtering.Booleanfalse
allowCreateEL nativeAllow creating new options.Booleanfalse
popperStyleEL nativeCustom dropdown-root styles.String / Array / Object / Booleanfalse
popperOptionsEL nativePopper positioning options.Object{}
debounceEL nativeRemote-search debounce in milliseconds.Number300
loadingTextEL nativeText shown while remote data loads.String加载中...
noMatchTextEL nativeText when filtering finds no matches.String暂无匹配的数据
noDataTextEL nativeText when no options/nodes exist.String暂无数据
remoteMethodEL nativeLoader called when remote-search keywords change.Function
filterMethodEL nativeLocal option-filtering function.Function
multipleEL nativeAllow multiple selection.Booleanfalse
multipleLimitEL nativeMaximum selections; 0 means unlimited.Number0
placeholderEL nativePlaceholder.String
defaultFirstOptionEL nativeSelect the first matching option on Enter.Booleanfalse
reserveKeywordEL nativeKeep the keyword after remote multiple selection.Booleantrue
valueKeyEL nativeUnique key field for object-valued options.Stringvalue
collapseTagsEL nativeCollapse tags in multiple selection.Booleantrue
collapseTagsTooltipEL nativeShow collapsed tags in a tooltip.Booleantrue
tagTooltipEL nativeCollapsed-tag tooltip options.Object{}
maxCollapseTagsEL nativeMaximum visible tags before collapsing.Number1
teleportedEL nativeTeleport the dropdown to appendTo.Booleantrue
persistentEL nativeKeep the hidden dropdown in the DOM.Booleantrue
clearIconEL nativeClear-button icon.String / Object / Function{"name":"CircleClose","__name":"circle-close"}
fitInputWidthEL nativeEnsure dropdown width is at least the input width.Booleanfalse
suffixIconEL nativeSelector suffix icon.String / Object / Function{"name":"ArrowDown","__name":"arrow-down"}
tagTypeEL nativeElement Plus type for selection tags.Stringinfo
tagEffectEL nativeElement Plus effect for selection tags.Stringlight
validateEventEL nativeTrigger form validation on model changes.Booleantrue
remoteShowSuffixEL nativeShow the selector suffix icon in remote mode.Booleanfalse
showArrowEL nativeShow the dropdown arrow pointing to its trigger.Booleantrue
offsetEL nativeOffset or overlay offset.Number12
placementEL nativePreferred dropdown placement relative to its trigger.Stringbottom-start
fallbackPlacementsEL nativeFallback overlay placements tried in order.Array["bottom-start","top-start","right","left"]
tabindexEL nativeNative input tabindex.String / Number0
appendToEL nativeOverlay mount target.String / Object
optionsEL nativeVirtual-selector options.Array
emptyValuesEL nativeModel values considered empty.Array
valueOnClearEL nativeValue or factory used when clearing the model.String / Number / Boolean / Functionfalse
ariaLabelEL nativeAccessible component name.String
Events(11)
NameSourceDescriptionParameters / type
update:modelValueEL nativeUpdates v-model.
changeEL nativeValue or selection changes.
popup-scrollEL nativeSelector dropdown scrolls.
end-reachedEL nativeSelector reaches a dropdown scroll boundary.
remove-tagEL nativeA multiple-selection tag is removed; receives the removed value.
visible-changeEL nativeSelector dropdown visibility changes.
focusEL nativeComponent gains focus.
blurEL nativeComponent loses focus.
clearEL nativeClear-button click after clearing completes.
update:labelFast additionUpdates the label model.
dataChangeFast additionAsynchronous data loading completes.
Slots(8)
NameSourceDescriptionParameters / type
defaultEL nativeDefault component content.
headerEL nativeCustom header or table-header business content.
footerEL nativeCustom footer actions; overlays provide loading and close.
prefixEL nativeCustom selector input prefix.
emptyEL nativeCustom empty-state content.
tagEL nativeCustom multiple-selection tags.
loadingEL nativeCustom loading content.
labelEL nativeCustom form, tree-node, or option label.
Expose(10)
NameSourceDescriptionParameters / type
focusEL nativeFocuses the input/selector.
blurEL nativeBlurs the input/selector.
selectedLabelEL nativeCurrent selector display label.
loadingFast additionFast business loading state.
refreshFast additionRepeats the data request or refreshes business content.
setSelectionFast additionSets the selector value and label.
clearSelectionFast additionClears the current selection.
selectedListFast additionComplete selected data objects.
scrollToEL native · not forwardedScrolls the table/virtual list to a position.
handleCloseEL native · not forwardedInvokes Element Plus internal closing behavior.

FaSelectPage instance methods

focus Focus

Focuses the selector input.

Signature

ts
focus(): void;

Example

vue
<template>
	<FaSelectPage ref="componentRef" />
</template>

<script setup lang="ts">
import { ref } from "vue";
import { FaSelectPage } from "fast-element-plus";

const componentRef = ref<InstanceType<typeof FaSelectPage>>();
componentRef.value?.focus();
</script>

Input

This method has no input parameters.

Returns

ValueTypeDescription
resultvoidNo return value.

blur Blur

Blurs the selector input and hides the dropdown.

Signature

ts
blur(): void;

Example

vue
<template>
	<FaSelectPage ref="componentRef" />
</template>

<script setup lang="ts">
import { ref } from "vue";
import { FaSelectPage } from "fast-element-plus";

const componentRef = ref<InstanceType<typeof FaSelectPage>>();
componentRef.value?.blur();
</script>

Input

This method has no input parameters.

Returns

ValueTypeDescription
resultvoidNo return value.

refresh Refresh

Refreshes.

Signature

ts
refresh(pageIndex?: number): Promise<void>;

Example

vue
<template>
	<FaSelectPage ref="componentRef" />
</template>

<script setup lang="ts">
import { ref } from "vue";
import { FaSelectPage } from "fast-element-plus";

const componentRef = ref<InstanceType<typeof FaSelectPage>>();
const result = await componentRef.value?.refresh(1);
</script>

Input

InputTypeRequired / defaultDescription
pageIndexnumber | undefinedOptionalPage to switch to during refresh.

Returns

ValueTypeDescription
resultPromise<void>Asynchronous result; callers handle Promise rejection.

setSelection Selection

Sets the selection.

Signature

ts
setSelection(value: Exclude<ElSelectorModelValue, null | undefined>): void;

Example

vue
<template>
	<FaSelectPage ref="componentRef" />
</template>

<script setup lang="ts">
import { ref } from "vue";
import { FaSelectPage } from "fast-element-plus";

const componentRef = ref<InstanceType<typeof FaSelectPage>>();
componentRef.value?.setSelection(1);
</script>

Input

InputTypeRequired / defaultDescription
valueElSelectorValue | ElSelectorValue[]RequiredForm value, selected value, or filter keyword to set.

Returns

ValueTypeDescription
resultvoidNo return value.

clearSelection Selection

Clears the selection.

Signature

ts
clearSelection(): void;

Example

vue
<template>
	<FaSelectPage ref="componentRef" />
</template>

<script setup lang="ts">
import { ref } from "vue";
import { FaSelectPage } from "fast-element-plus";

const componentRef = ref<InstanceType<typeof FaSelectPage>>();
componentRef.value?.clearSelection();
</script>

Input

This method has no input parameters.

Returns

ValueTypeDescription
resultvoidNo return value.

State and lifecycle

The latest valid response wins labels by value; old selected entries only retain off-page values. Clearing selection or replacing initParam removes stale display state. Disposed or superseded requests cannot update state.