Skip to content

FaInputDialogPage

A readonly input opens a selection dialog containing a paginated FaTable. Supports single selection, double-click confirmation, clearing, selected labels and table-column slots.

Input Dialog Page

View code
Vue
<template>
	<div class="demo-stack">
		<FaInputDialogPage
			v-model="value"
			v-model:label="label"
			:request-api="requestApi"
			row-key="id"
			label-key="name"
			title="选择 Fast 项目"
			placeholder="请选择项目"
			@change="changedData = $event"
		>
			<FaTableColumn prop="name" label="项目" min-width="180" />
			<FaTableColumn prop="owner" label="团队" width="120" />
			<FaTableColumn prop="status" label="状态" width="100" />
		</FaInputDialogPage>
		<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>(2);
const label = ref<string | null>("Fast.Element.Plus");
const changedData = ref<unknown>();
const rows = [
	{ id: 1, name: "Fast.NET", owner: "SDK 团队", status: "稳定" },
	{ id: 2, name: "Fast.Element.Plus", owner: "前端团队", status: "开发中" },
	{ id: 3, name: "Fast.Admin", owner: "业务团队", status: "稳定" },
];

const requestApi = (_input?: PagedInput): Promise<PagedResult<Record<string, unknown>>> =>
	Promise.resolve({
		pageIndex: 1,
		pageSize: 20,
		totalRows: rows.length,
		rows,
	});
</script>

FaInputDialogPage Complete API

Props (9)
PropertySourceDescriptionTypeDefault
rowKeyFast additionUnique row or node key.String / Functionid
modelValueFast additionv-model value.String / Number
labelFast additionDisplay text or synchronized label.String
placeholderFast additionPlaceholder.String请选择
disabledFast additionDisable the component or current option.Booleanfalse
titleFast additionComponent title.String
requestApiFast additionAsynchronous data-request function.Function
initParamFast additionInitial request parameters.String / Number / Object
labelKeyFast additionLabel field of the selected row.Stringname
Events(3)
NameSourceDescriptionParameters / type
update:modelValueFast additionUpdates v-model.
update:labelFast additionUpdates the label model.
changeFast additionValue or selection changes.
Slots(1)
NameSourceDescriptionParameters / type
default(FaTableColumn)Fast additionFaTableColumn declarations for the dialog selector's table.(FaTableColumn)
Expose(3)
NameSourceDescriptionParameters / type
selectionRowFast additionCurrently selected dialog-page rows.
openFast additionRuns the Fast asynchronous opening flow.
clearFast additionClears the current selected value.

FaInputDialogPage instance methods

open Open

Opens the selector dialog.

Signature

ts
open(): Promise<void>;

Example

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

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

const componentRef = ref<InstanceType<typeof FaInputDialogPage>>();
const result = await componentRef.value?.open();
</script>

Input

This method has no input parameters.

Returns

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

clear Clear

Clears the selection.

Signature

ts
clear(): void;

Example

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

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

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

Input

This method has no input parameters.

Returns

ValueTypeDescription
resultvoidNo return value.