Skip to content

FaTable ​

FaTable adds search forms, pagination, remote requests, column settings and row selection to Element Plus Table.

Since 2.0.28, style applies to the outer FaTable wrapper, and #append renders when supplied. empty-text overrides the default empty-state text. FaTableColumn exposes filterOpened to #filterIcon. Its #expand slot receives expanded and expandable, and show-overflow-tooltip forwards object options.

Common examples ​

Basic usage ​

Basic

Interactive example
View code
Vue
<template>
	<FaTable :data="rows" :pagination="false" :tool-btn="false" hide-search-time>
		<FaTableColumn prop="name" label="项目" min-width="180" copy />
		<FaTableColumn prop="owner" label="负责人" width="120" />
		<FaTableColumn prop="status" label="状态" width="100" tag :enum="statusOptions" />
		<FaTableColumn prop="createdTime" label="创建时间" type="dateTime" width="180" />
	</FaTable>
</template>

<script setup lang="ts">
import type { FaTableEnumColumnCtx } from "fast-element-plus";

const rows = [
	{ id: 1, name: "Fast Admin", status: 1, owner: "小方", createdTime: "2026-08-20 09:30:00" },
	{ id: 2, name: "Fast Element Plus", status: 1, owner: "Fast 团队", createdTime: "2026-08-22 14:10:00" },
	{ id: 3, name: "Fast.NET", status: 0, owner: "SDK 团队", createdTime: "2026-08-25 18:20:00" },
];

const statusOptions: FaTableEnumColumnCtx[] = [
	{ label: "停用", value: 0, type: "danger" },
	{ label: "启用", value: 1, type: "success" },
];
</script>

Remote pagination ​

This demo simulates an API with local data. requestApi receives paging and search parameters. Return the current page in rows and the total matching count in totalRows. See the runnable integration example and troubleshooting.

Interactive example
View code
Vue
<template>
	<FaTable :request-api="requestApi" :columns="columns" column-setting-btn>
		<template v-if="english" #empty>No rows found</template>
	</FaTable>
</template>

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

const props = defineProps<{ language?: "zh-CN" | "en-US" }>();
const english = computed(() => props.language === "en-US");
const statuses = computed<FaTableEnumColumnCtx[]>(() => [
	{ label: english.value ? "Inactive" : "停用", value: 0, type: "danger" },
	{ label: english.value ? "Active" : "启用", value: 1, type: "success" },
]);
const allRows = computed(() => {
	const owners = english.value ? ["Platform", "Business", "SDK"] : ["平台组", "业务组", "SDK 组"];
	return Array.from({ length: 57 }, (_, index) => ({
		id: index + 1,
		name: `${english.value ? "Module" : "业务模块"} ${String(index + 1).padStart(2, "0")}`,
		owner: owners[index % owners.length],
		status: index % 4 === 0 ? 0 : 1,
		createdTime: `2026-08-${String((index % 26) + 1).padStart(2, "0")} 10:30:00`,
	}));
});
const columns = computed<FaTableColumnCtx[]>(() => [
	{ prop: "name", label: english.value ? "Module name" : "模块名称", minWidth: 180, copy: true, search: { el: "el-input", order: 3 } },
	{ prop: "owner", label: english.value ? "Owner" : "负责人", width: 120, search: { el: "el-input", order: 2 } },
	{ prop: "status", label: english.value ? "Status" : "状态", width: 100, tag: true, enum: statuses.value, search: { el: "el-select", order: 1 } },
	{ prop: "createdTime", label: english.value ? "Created at" : "创建时间", type: "dateTime", width: 180 },
]);

const requestApi = async (input?: PagedInput): Promise<PagedResult<Record<string, unknown>>> => {
	await new Promise<void>((resolve) => {
		window.setTimeout(resolve, 300);
	});
	let result = allRows.value;
	for (const key of ["name", "owner", "status"] satisfies Array<keyof (typeof allRows.value)[number]>) {
		const value: unknown = input?.[key];
		if (value === undefined || value === null || value === "") continue;
		if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") continue;
		result = result.filter((row) => String(row[key]).includes(String(value)));
	}
	const pageIndex = input?.pageIndex ?? 1;
	const pageSize = input?.pageSize ?? 20;
	return {
		pageIndex,
		pageSize,
		totalRows: result.length,
		rows: result.slice((pageIndex - 1) * pageSize, pageIndex * pageSize),
	};
};
</script>

Row selection ​

Selection

Interactive example
View code
Vue
<template>
	<div class="demo-stack">
		<FaTable
			:data="rows"
			:pagination="false"
			:tool-btn="false"
			hide-search-time
			selection-column
			single
			row-click-selection
			:row-selectable="handleRowSelectable"
			@selection-change="handleSelectionChange"
		>
			<FaTableColumn prop="name" label="名称" min-width="180" />
			<FaTableColumn prop="locked" label="是否锁定" width="120">
				<template #default="{ row }"
					><ElTag :type="row['locked'] ? 'danger' : 'success'">{{ row["locked"] ? "锁定" : "可选" }}</ElTag></template
				>
			</FaTableColumn>
		</FaTable>
		<span class="demo-value">当前单选:{{ selectedNames.join("、") || "未选择" }}</span>
	</div>
</template>

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

const selectedNames = ref<string[]>([]);
const rows = [
	{ id: 1, name: "可选择记录", locked: false },
	{ id: 2, name: "锁定记录", locked: true },
	{ id: 3, name: "点击整行选择", locked: false },
];
const handleRowSelectable = (row: DefaultRow): boolean => !row["locked"];
const handleSelectionChange = (selection: DefaultRow[]): void => {
	selectedNames.value = selection.map((item) => String(item["name"]));
};
</script>

Advanced table examples ​

Tree Table

Interactive example
View code
Vue
<template>
	<FaTable :data="rows" default-expand-all :pagination="false" :tool-btn="false" hide-search-time>
		<FaTableColumn prop="name" label="模块" min-width="220" />
		<FaTableColumn prop="owner" label="负责团队" min-width="160" />
	</FaTable>
</template>

<script setup lang="ts">
const rows = [
	{
		id: 1,
		name: "组件",
		owner: "前端团队",
		children: [
			{ id: 11, name: "表单组件", owner: "表单小组" },
			{ id: 12, name: "表格组件", owner: "数据小组" },
		],
	},
	{
		id: 2,
		name: "SDK",
		owner: "平台团队",
		children: [{ id: 21, name: "Fast.NET", owner: "SDK 小组" }],
	},
];
</script>

Native Element Plus tree tables need only row-key and children data. Leave tree-data unset; Fast treeData flattens grouped children into ordinary rows.

Expandable Rows

Interactive example
View code
Vue
<template>
	<div class="demo-stack">
		<FaTable :data="rows" :pagination="false" :tool-btn="false" hide-search-time @expand-change="handleExpand">
			<template #expand="{ row }">
				<div v-if="row">
					<strong>{{ row["name"] }}</strong>
					<p style="margin: 6px 0 0">{{ row["description"] }}</p>
				</div>
			</template>
			<FaTableColumn prop="name" label="项目" min-width="200" />
			<FaTableColumn prop="owner" label="负责团队" min-width="140" />
		</FaTable>
		<span class="demo-value">已展开:{{ expandedNames.join("、") || "无" }}</span>
	</div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const expandedNames = ref<string[]>([]);
const rows = [
	{ id: 1, name: "Fast.Element.Plus", owner: "Fast 团队", description: "面向团队编码习惯封装的 Element Plus 业务组件库。" },
	{ id: 2, name: "Fast.NET", owner: "SDK 团队", description: "Fast 系列 .NET SDK 基础能力。" },
	{ id: 3, name: "Fast.Admin", owner: "平台团队", description: "后台管理与权限业务应用。" },
];

const handleExpand = (row: Record<string, unknown>, expanded: boolean | Record<string, unknown>[]): void => {
	const name = String(row["name"]);
	if (Array.isArray(expanded)) {
		expandedNames.value = expanded.map((item) => String(item["name"]));
	} else if (expanded) {
		expandedNames.value = [...new Set([...expandedNames.value, name])];
	} else {
		expandedNames.value = expandedNames.value.filter((item) => item !== name);
	}
};
</script>

Sort Filter Fixed

Interactive example
View code
Vue
<template>
	<FaTable :data="rows" :pagination="false" :tool-btn="false" height="320" hide-search-time border @sort-change="handleSort">
		<FaTableColumn prop="name" label="名称" min-width="230" fixed show-overflow-tooltip />
		<FaTableColumn prop="owner" label="负责人" width="110" />
		<FaTableColumn
			prop="status"
			label="状态筛选"
			width="130"
			:filters="[
				{ text: '进行中', value: '进行中' },
				{ text: '已完成', value: '已完成' },
				{ text: '已暂停', value: '已暂停' },
			]"
			:filter-method="filterStatus"
		/>
		<FaTableColumn prop="visits" label="访问量排序" width="140" sortable align="right" />
		<FaTableColumn label="固定操作" width="110" fixed="right">
			<template #default="{ row }"
				><ElButton link type="primary">查看 {{ row["id"] }}</ElButton></template
			>
		</FaTableColumn>
	</FaTable>
</template>

<script setup lang="ts">
import { ref } from "vue";

interface RowData {
	id: number;
	name: string;
	owner: string;
	status: string;
	visits: number;
}

const sourceRows: RowData[] = [
	{ id: 1, name: "Fast.Element.Plus 文档与案例建设", owner: "小方", status: "进行中", visits: 1860 },
	{ id: 2, name: "Fast.NET SDK", owner: "研发组", status: "已完成", visits: 5320 },
	{ id: 3, name: "Fast.Admin 权限中心", owner: "平台组", status: "进行中", visits: 2980 },
	{ id: 4, name: "移动端业务门户", owner: "前端组", status: "已暂停", visits: 920 },
];
const rows = ref([...sourceRows]);

const filterStatus = (value: unknown, row: Record<string, unknown>): boolean => row["status"] === value;
const handleSort = ({ prop, order }: { order: "" | "ascending" | "descending"; prop: string }): void => {
	if (!order) {
		rows.value = [...sourceRows];
		return;
	}
	const key = prop as keyof RowData;
	const direction = order === "ascending" ? 1 : -1;
	rows.value = [...sourceRows].sort((left, right) => {
		const leftValue = Number(left[key]);
		const rightValue = Number(right[key]);
		return leftValue === rightValue ? 0 : leftValue > rightValue ? direction : -direction;
	});
};
</script>

Slots Expose

Interactive example
View code
Vue
<template>
	<FaTable ref="tableRef" :data="rows" :pagination="false" hide-search-time>
		<template #header><ElTag type="primary">自定义头部插槽</ElTag></template>
		<template #toolButton>
			<ElButton type="primary" @click="tableRef?.refresh()">刷新</ElButton>
			<ElButton @click="tableRef?.reset()">重置</ElButton>
		</template>
		<FaTableColumn prop="name" label="项目" min-width="180" />
		<FaTableColumn prop="version" label="版本" width="120" />
		<template #operation="{ row }"><ElButton link type="primary" @click="ElMessage.info(`查看 ${String(row['name'])}`)">查看</ElButton></template>
		<template #footer
			><div class="demo-value">表格 Loading:{{ tableRef?.loading ? "是" : "否" }}</div></template
		>
	</FaTable>
</template>

<script setup lang="ts">
import { useTemplateRef } from "vue";
import { ElMessage } from "element-plus";
import { version } from "fast-element-plus";

interface TableExpose {
	loading: boolean;
	refresh: () => Promise<void>;
	reset: () => Promise<void>;
}

const tableRef = useTemplateRef<TableExpose>("tableRef");
const rows = [
	{ id: 1, name: "Fast.Element.Plus", version },
	{ id: 2, name: "Fast.NET.Core", version: "3.5.42" },
];
</script>

Updating a lazy node ​

Lazy child rows

Interactive example
View code
Vue
<template>
	<div class="demo-stack">
		<ElButton :disabled="!isLoaded" @click="handleReplace">替换子行</ElButton>
		<FaTable ref="tableRef" :data="rows" row-key="id" lazy :load="handleLoad" :pagination="false" :tool-btn="false" hide-search-time>
			<FaTableColumn prop="name" label="节点" />
		</FaTable>
	</div>
</template>

<script setup lang="ts">
import { ref, useTemplateRef } from "vue";
import { ElButton } from "element-plus";
import { FaTable, FaTableColumn } from "fast-element-plus";
import type { DefaultRow } from "fast-element-plus";

const tableRef = useTemplateRef<{ updateKeyChildren: (key: string, data: DefaultRow[]) => void }>("tableRef");
const isLoaded = ref(false);
const rows = [{ id: "parent", name: "父行", hasChildren: true }];

function handleLoad(_row: DefaultRow, _node: unknown, resolve: (rows: DefaultRow[]) => void) {
	resolve([{ id: "original", name: "初始子行" }]);
	isLoaded.value = true;
}

function handleReplace() {
	tableRef.value?.updateKeyChildren("parent", [{ id: "replacement", name: "替换后的子行" }]);
}
</script>

FaTable Complete API

Props

EL defaults refer to Element Plus before Fast is imported. 2.14.7

PropertySourceDescriptionTypeDefault
dataFast overrideComponent data.ArrayFast[]EL[]
sizeFast overrideComponent size.StringFast—EL—
heightFast overrideComponent height.String / NumberFast—EL—
borderFast global enhancementShow table borders.BooleanFasttrueELfalse
rowKeyFast global enhancementUnique row or node key.String / FunctionFastidEL—
highlightCurrentRowFast global enhancementwhether current row is highlightedBooleanFasttrueELfalse
tableKeyFast additionUnique key for the table instance and persisted settings.StringGenerated at runtime
requestApiFast additionAsynchronous data-request function.(params?: PagedInput) => Promise<PagedResult<DefaultRow> | DefaultRow[]>—
dataCallbackFast additionTransformation/callback after table data loads.(data: PagedResult<DefaultRow> | DefaultRow[]) => void—
initParamFast additionInitial request parameters.String / Number / Object—
columnsFast additionTable column configuration.Array / Booleanfalse
columnsChangeFast additionColumn-settings change callback.Function—
searchFormColsFast additionResponsive search-form column counts.String / Number / Object{"xs":2,"sm":3,"md":4,"lg":5,"xl":6}
collapsedSearchFast additionCollapse table search conditions by default.Booleantrue
advancedSearchDrawerFast additionShow advanced search inside a drawer.Booleanfalse
searchFormFast additionInitial search-form values.Booleantrue
headerCardFast additionUse card styling for the table header area.Booleantrue
refreshBtnFast additionShow refresh button.Booleantrue
searchBtnFast additionShow search button.Booleantrue
columnSettingBtnFast additionShow column-settings button.Booleanfalse
toolBtnFast additionShow table tools.Booleantrue
hideSearchTimeFast additionHide the default time-search field.Booleanfalse
futureSearchTimeFast additionAllow future dates in time search.Booleanfalse
dataSearchRangeFast additionDefault table time-search range.StringPast3D
selectionColumnFast additionShow the built-in selection column; defaults to false (since 2.0.23).Booleanfalse
indexColumnFast additionShow the built-in index column; defaults to true (since 2.0.23).Booleantrue
paginationFast additionShow pagination or configure pagination.Booleantrue
pageSizesFast additionAvailable page sizes.Array[20,30,50,100]
hideImageFast additionHide image-column preview.Booleanfalse
singleFast additionUse single-select table mode.Booleanfalse
rowClickSelectionFast additionToggle selection on row click.Booleanfalse
treeDataFast additionFlattens each parent's children into table rows and merges parent fields into them; native Element Plus tree-table expansion does not require this.Booleanfalse
propsFast additionField mappings.Object{"children":"children"}
autoRefreshFast additionRefresh automatically according to configuration.Booleantrue
rowSelectableFast additionPredicate controlling row selectability.Function—
widthEL nativeComponent width.String / Number—
maxHeightEL nativetable's max-height. The legal value is a number or the height in pxString / Number—
fitEL nativeHow content fits its container.Booleantrue
stripeEL nativeShow striped rows.Booleanfalse
showHeaderEL nativewhether Table header is visibleBooleantrue
showSummaryEL nativewhether to display a summary rowBooleanfalse
sumTextEL nativedisplayed text for the first column of summary rowString—
summaryMethodEL nativecustom summary methodFunction—
rowClassNameEL nativefunction that returns custom class names for a row, or a string assigning class names for every rowString / Function—
rowStyleEL nativefunction that returns custom style for a row, or an object assigning custom style for every rowObject / Function—
cellClassNameEL nativefunction that returns custom class names for a cell, or a string assigning class names for every cellString / Function—
cellStyleEL nativefunction that returns custom style for a cell, or an object assigning custom style for every cellObject / Function—
headerRowClassNameEL nativefunction that returns custom class names for a row in table header, or a string assigning class names for every row in table headerString / Function—
headerRowStyleEL nativefunction that returns custom style for a row in table header, or an object assigning custom style for every row in table headerObject / Function—
headerCellClassNameEL nativefunction that returns custom class names for a cell in table header, or a string assigning class names for every cell in table headerString / Function—
headerCellStyleEL nativefunction that returns custom style for a cell in table header, or an object assigning custom style for every cell in table headerObject / Function—
currentRowKeyEL nativekey of current row, a set only propString / Number—
emptyTextEL nativeEmpty-state text.String—
expandRowKeysEL nativeset expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop.Array—
rowExpandableEL nativeenable expandable rows, works when the table has a column type="expand"Function—
defaultExpandAllEL nativeExpand all nodes by default.Booleanfalse
defaultSortEL nativeset the default sort column and order. property prop is used to set default sort column, property order is used to set default sort orderObject—
tooltipEffectEL nativethe effect of the overflow tooltipString—
tooltipOptionsEL nativethe options for the overflow tooltip, see the following tooltip componentObject—
spanMethodEL nativemethod that returns rowspan and colspanFunction—
selectOnIndeterminateEL nativecontrols the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselectedBooleantrue
indentEL nativeHorizontal tree-level indentation in pixels.Number16
treePropsEL nativeconfiguration for rendering nested dataObject{"hasChildren":"hasChildren","children":"children","checkStrictly":false}
lazyEL nativeEnable lazy loading.Booleanfalse
loadEL nativeLazy tree-node loader.Function—
styleEL nativeCustom table cell/header styles.Object{}
classNameEL nativeCustom table cell/header class.String""
tableLayoutEL nativesets the algorithm used to lay out table cells, rows, and columnsStringfixed
scrollbarAlwaysOnEL nativealways show scrollbarBooleanfalse
flexibleEL nativeensure main axis minimum-size doesn't follow the contentBooleanfalse
showOverflowTooltipEL nativewhether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns, refer to table tooltip-optionsBoolean / Objectfalse
tooltipFormatterEL nativecustomize tooltip content when using show-overflow-tooltipFunction—
appendFilterPanelToEL nativewhich element the filter panels appends toString—
scrollbarTabindexEL nativebody scrollbar's wrap container tabindexNumber / String—
allowDragLastColumnEL nativewhether to allow drag the last columnBooleantrue
preserveExpandedContentEL nativewhether to preserve expanded row content in DOM when collapsedBooleanfalse
nativeScrollbarEL nativewhether to use native scrollbarsBooleanfalse

Events

NameSourceDescriptionParameters / type
selectEL nativeRow or option selection.—
selectAllEL nativeTable select-all state changes, with currently selected rows.—
selectionChangeEL nativeTable selection collection changes.(newSelection: DefaultRow[])
cellMouseEnterEL nativePointer enters a cell.—
cellMouseLeaveEL nativePointer leaves a cell.—
cellClickEL nativeCell click with row, column, cell, and native event.—
cellDblclickEL nativeCell double-click.—
cellContextmenuEL nativeCell context-menu event.—
rowClickEL nativeTable-row click; arguments match ElTable row-click.—
rowContextmenuEL nativeTable-row context menu.—
rowDblclickEL nativeTable-row double-click.—
headerClickEL nativeHeader-cell click.—
headerContextmenuEL nativeHeader-cell context menu.—
sortChangeEL nativeTable sorting changes.(data: { column: TableColumnCtx<DefaultRow>; prop: string; order: "" | "ascending" | "descending" })
filterChangeEL nativeTable filters change.—
currentChangeEL nativeCurrent table row, tree node, or selected value changes.—
headerDragendEL nativeColumn-width dragging ends.—
expandChangeEL nativeTable-row expansion changes.—
scrollEL nativeTable or selector scrolls.—
refreshFast additionData refresh event.—
resetFast additionSearch-reset event.—
sizeChangeFast additionTable page size changes.—
paginationChangeFast additionTable page number or page size changes.—
customCellClickFast additionFast link-column click with custom event name and cell context.—

Slots

NameSourceDescriptionParameters / type
defaultEL nativeDefault component content.—
appendEL nativeCustom content after the last table row.—
emptyEL nativeCustom empty-state content.—
topHeaderFast additionCustom content at the very top of the table.—
headerFast additionCustom header or table-header business content.—
toolButtonFast additionCustom common table tools.—
toolButtonAdvFast additionCustom advanced table tools.—
expand({ row, column, $index, ...tableContext })Fast additionCustom expansion content; providing the slot enables the expansion column (since 2.0.23). Scope includes row, column, $index and table context.({ row, column, $index, ...tableContext })
operationFast additionCustom table action-column content.—
paginationFast additionCustom pagination area.—
footerFast additionCustom footer actions; overlays provide loading and close.—
columnSettingFast additionCustom table column-settings area.—
Dynamic named column/search slotsFast additionBusiness slots generated from column slot/headerSlot or search-field names.—

Exposes

NameSourceDescriptionParameters / type
clearSelectionEL nativeClears the current selection.—
getSelectionRowsEL nativeGets currently selected table rows.—
getHalfSelectionRowsFast additionGets partially selected tree-table rows.—
toggleRowSelectionEL nativeToggles selection for a table row.—
toggleAllSelectionEL nativeToggles table select-all.—
toggleRowExpansionEL nativeToggles a table row's expansion.—
setCurrentRowEL nativeSets the highlighted table row.—
clearSortEL nativeClears table sorting.—
clearFilterEL nativeClears table column filters.—
doLayoutEL nativeRecalculates table layout.—
sortEL nativeSorts the table by column and order.—
scrollToEL nativeScrolls the table/virtual list to a position.—
setScrollTopEL nativeSets vertical table scroll.—
setScrollLeftEL nativeSets horizontal table scroll.—
columnsEL nativeCurrently rendered ElTable column contexts.—
updateKeyChildrenEL nativeUpdates tree/tree-table children by node key.—
loadingFast additionFast business loading state.—
tableDataFast additionCurrently rendered table data.—
tablePaginationFast additionCurrent pagination state.—
searchParamFast additionSearch parameters currently passed to the request function.—
selectedFast additionWhether any table rows are selected.—
selectedListFast additionComplete selected data objects.—
selectedListIdsFast additionPrimary keys of selected rows.—
indeterminateSelectedListIdsFast additionPrimary keys of partially selected tree-table rows.—
tableWidthFast additionCalculated available table width.—
tableHeightFast additionCalculated available table height.—
toggleRowIndeterminateSelectionFast additionToggles partial selection for a tree-table row.—
refreshFast additionRepeats the data request or refreshes business content.—
resetFast additionResets table search, pagination, and data.—
doRenderFast additionForces table recalculation and rendering.—
doLoadingFast additionRuns a sync/async function with shared loading and overlay state.—

Adds image, date/time, decimal precision, thousands separators, copy, links, tags, merged rows, and time-information columns to native ElTableColumn capabilities.

Column Types

Interactive example
View code
Vue
<template>
	<FaTable :data="rows" :pagination="false" :tool-btn="false" hide-search-time>
		<FaTableColumn prop="details.image" label="图片" type="image" original-image width="90" />
		<FaTableColumn prop="details.name" label="名称" min-width="180" copy link :click="handleLinkClick" />
		<FaTableColumn prop="amount" label="千分位" type="gd2" width="130" align="right" />
		<FaTableColumn prop="ratio" label="六位小数" type="d6" width="120" align="right" />
		<FaTableColumn prop="status" label="枚举标签" tag :enum="statuses" width="100" />
		<FaTableColumn prop="details.createdTime" label="日期时间" type="dateTime" width="180" />
	</FaTable>
</template>

<script setup lang="ts">
import { ElMessage } from "element-plus";
import type { FaTableEnumColumnCtx } from "fast-element-plus";

const image = `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(
	'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 80"><rect width="120" height="80" rx="8" fill="#409eff"/><text x="60" y="48" text-anchor="middle" font-size="20" fill="white">Fast</text></svg>'
)}`;
const rows = [
	{
		id: 1,
		details: { name: "Fast.Element.Plus", image, createdTime: "2026-08-26 09:30:00" },
		amount: 12345.6,
		ratio: 0.876543,
		status: 1,
	},
	{
		id: 2,
		details: { name: "Fast.NET", image, createdTime: "2026-08-25 16:20:00" },
		amount: 9876543.21,
		ratio: 0.123456,
		status: 0,
	},
];
const statuses: FaTableEnumColumnCtx[] = [
	{ label: "停用", value: 0, type: "danger" },
	{ label: "启用", value: 1, type: "success" },
];
const handleLinkClick = ({ row }: { row: Record<string, unknown> }): void => {
	ElMessage.info(`Row ${String(row["id"])}`);
};
</script>

Image Columns

Interactive example
View code
Vue
<template>
	<FaTable :data="rows" :pagination="false" :tool-btn="false" hide-search-time>
		<FaTableColumn prop="cover" label="缩略图与预览" type="image" original-image width="130" />
		<FaTableColumn prop="cover" label="隐藏缩略图" type="image" hide-image width="130" />
		<FaTableColumn prop="name" label="资源名称" min-width="180" />
	</FaTable>
</template>

<script setup lang="ts">
const createImage = (text: string, color: string): string =>
	`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(
		`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 200"><rect width="320" height="200" rx="20" fill="${color}"/><circle cx="70" cy="70" r="32" fill="rgba(255,255,255,.32)"/><path d="M30 170 105 105l48 42 42-32 95 55" fill="none" stroke="white" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"/><text x="250" y="58" text-anchor="middle" font-size="30" fill="white">${text}</text></svg>`
	)}`;

const rows = [
	{ id: 1, name: "项目封面", cover: createImage("封面", "#409eff") },
	{ id: 2, name: "产品截图", cover: createImage("截图", "#67c23a") },
	{ id: 3, name: "无图片占位", cover: "" },
];
</script>

Set spanProp: "department" on the department column in columns. Adjacent rows with the same department share one department cell while tasks and activity remain separate.

In 2.0.27, the built-in row numbers can repeat when only business columns use spanProp. This example disables the built-in index column with :index-column="false".

Merge Time Info

Interactive example
View code
Vue
<template>
	<FaTable :data="rows" :columns="columns" :pagination="false" :tool-btn="false" :index-column="false" hide-search-time border />
</template>

<script setup lang="ts">
import { computed } from "vue";
import { FaTable } from "fast-element-plus";
import type { FaTableColumnCtx } from "fast-element-plus";

const props = defineProps<{ language?: string }>();
const english = computed(() => props.language === "en-US");

const columns = computed<FaTableColumnCtx[]>(() => [
	{ prop: "department", label: english.value ? "Department (merged)" : "部门(自动合并)", spanProp: "department", minWidth: 150 },
	{ prop: "name", label: english.value ? "Task" : "工作事项", minWidth: 180 },
	{ prop: "createdTime", label: english.value ? "Activity" : "操作信息", type: "timeInfo", minWidth: 240 },
]);

const rows = computed(() => [
	{
		id: 1,
		department: english.value ? "Engineering" : "研发中心",
		name: english.value ? "Maintain components" : "组件库维护",
		createdUserName: "Fang",
		createdTime: "2026-08-27 09:20:00",
	},
	{
		id: 2,
		department: english.value ? "Engineering" : "研发中心",
		name: english.value ? "Build the docs site" : "文档站建设",
		createdUserName: english.value ? "Frontend team" : "前端组",
		createdTime: "2026-08-27 10:35:00",
	},
	{
		id: 3,
		department: english.value ? "Product" : "产品中心",
		name: english.value ? "Review requirements" : "需求评审",
		createdUserName: english.value ? "Product team" : "产品组",
		createdTime: "2026-08-26 16:10:00",
	},
]);
</script>

Fast column types ​

TypePurpose
defaultDefault business column
imageImages and previews
date, time, dateTimeDate, time, and date-time formatting
d2, d4, d6Fixed 2, 4, or 6 decimal places
gd2, gd4, gd6Fixed precision with thousands separators
timeInfoCombined user and time information

Props

EL defaults refer to Element Plus before Fast is imported. 2.14.7

PropertySourceDescriptionTypeDefault
typeFast overrideFast business column type.StringFastdefaultELdefault
widthFast overrideComponent width.String / NumberFastautoEL""
alignFast overridealignmentStringFastleftEL—
headerAlignFast overridealignment of the table header. If omitted, the value of the above align attribute will be appliedStringFastleftEL—
showFast additionShow the current column or layout item.Booleanfalse
smallWidthFast additionTable column width in small mode.String / Number—
autoWidthFast additionCalculate column width from cell content.Booleanfalse
slotFast additionNamed slot for a custom table cell.String—
headerSlotFast additionNamed slot for a custom table header.String—
headerRenderFast additionTSX table-header renderer.Function—
renderFast additionTSX table-cell renderer.Function—
_childrenFast additionChild-column configuration for grouped headers.Array—
hideImageFast additionHide image-column preview.Booleanfalse
copyFast additionShow cell copy action.Booleanfalse
linkFast additionRender cells as link buttons.Booleanfalse
spanPropFast additionField used for vertical row spanning.String—
clickFast additionLink-column click callback receiving row and row index.Function—
clickEmitFast additionCustom event name emitted by link-column clicks.String—
originalImageFast additionUse original images for image-column display and preview.Booleanfalse
dateFixFast additionAlso show a relative-time label in date columns.Booleanfalse
dateFormatFast additionCustom date-column format.String—
tagFast additionRender cells as enum tags.Booleanfalse
enumFast additionEnum options, dictionary name, or per-row dictionary factory.String / Array / Function—
dataDeleteFieldFast additionLogical-deletion field; matching cells display a deletion overlay.String—
timeInfoFieldFast additionUsername/time field mappings for time-info columns.Object{"userName":"createdUserName","time":"createdTime"}
labelEL nativeDisplay text or synchronized label.String—
classNameEL nativeCustom table cell/header class.String—
labelClassNameEL nativeclass name of the label of this columnString—
propertyEL nativeTable data field, equivalent to prop.String—
propEL nativefield name. You can also use its alias: propertyString—
minWidthEL nativecolumn minimum width. Columns with width has a fixed width, while columns with min-width has a width that is distributed in proportionString / Number""
renderHeaderEL nativerender function for table header of this columnFunction—
sortableEL nativewhether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the sort-change event of TableBoolean / Stringfalse
sortMethodEL nativesorting method, works when sortable is true. Should return a number, just like Array.sortFunction—
sortByEL nativespecify which property to sort by, works when sortable is true and sort-method is undefined. If set to an Array, the column will sequentially sort by the next property if the previous one is equalString / Function / Array—
resizableEL nativeAllow drawer resizing.Booleantrue
columnKeyEL nativecolumn's key. If you need to use the filter-change event, you need this attribute to identify which column is being filteredString—
showOverflowTooltipEL nativewhether to hide extra content and show them in a tooltip when hovering on the cellBoolean / Objectfalse
tooltipFormatterEL nativecustomize tooltip content when using show-overflow-tooltipFunction—
fixedEL nativewhether column is fixed at left / right. Will be fixed at left if trueBoolean / Stringfalse
formatterEL nativeDisplay-value formatter.Function—
selectableEL nativefunction that determines if a certain row can be selected, works when type is 'selection'Function—
reserveSelectionEL nativewhether to reserve selection after data refreshing, works when type is 'selection'. Note that row-key is required for this to workBooleanfalse
filterMethodEL nativeLocal option-filtering function.Function—
filteredValueEL nativefilter value for selected data, might be useful when table header is rendered with render-headerArray—
filtersEL nativean array of data filtering options. For each element in this array, text and value are requiredArray—
filterPlacementEL nativeplacement for the filter dropdownString—
filterMultipleEL nativewhether data filtering supports multiple optionsBooleantrue
filterClassNameEL nativeclassName for the filter dropdownString—
indexEL nativecustomize indices for each row, works on columns with type=indexNumber / Function—
sortOrdersEL nativethe order of the sorting strategies used when sorting the data, works when sortable is true. Accepts an array, as the user clicks on the header, the column is sorted in order of the elements in the arrayArray["ascending","descending",null]

Events

NameSourceDescriptionParameters / type
imagePreviewFast additionImage preview opens, with the image URL.—
customCellClickFast additionFast link-column click with custom event name and cell context.—

Slots

NameSourceDescriptionParameters / type
default(scope)EL nativeCustom cell content with row, column, and row index.(scope)
header(scope)EL nativeCustom column header with column and column index.(scope)
filter-iconEL native · not forwardedCustom content for filter icon{ filterOpened: boolean }
expandEL native · not forwardedCustom content for expand columns. The expandable property is supported starting from v2.13.2.{ expanded: boolean, expandable: boolean }

Internal column-settings dialog controlled by columnSettingBtn. Reorder using the left drag handle; touch interaction requires a short hold before dragging to avoid accidental sorting while scrolling. Requires FaTable state; use through FaTable.TableColumnsSettingDialog or internal table flows.

Props

PropertySourceDescriptionTypeDefault
changeFast additionPersistence callback after column settings change.Function—

Exposes

NameSourceDescriptionParameters / type
openFast additionRuns the Fast asynchronous opening flow.—
changeFast additionPublic component instance member.—

Internal pagination bar reading table state and emitting page/page-size changes. Requires FaTable context and is not a standalone pagination component.

Props

PropertySourceDescriptionTypeDefault
pageSizesFast additionAvailable page sizes.Array[20,30,50,100]

Events

NameSourceDescriptionParameters / type
sizeChangeFast additionTable page size changes.—
currentChangeFast additionCurrent table row, tree node, or selected value changes.—

Responsive table search container handling basic/advanced search, collapse, and reset. Normally created by FaTable from column configuration.

Props

PropertySourceDescriptionTypeDefault
showRequiredFast additionShow the current column or layout item.Booleanfalse
collapsedSearchFast additionCollapse table search conditions by default.Booleantrue
advancedSearchDrawerFast additionShow advanced search inside a drawer.Booleanfalse
colsFast additionColumn counts at responsive breakpoints.String / Number / Object{"xs":2,"sm":3,"md":4,"lg":5,"xl":6}
searchRequiredFast additionAsynchronous table-search function.Function—
resetRequiredFast additionAsynchronous search-reset function.Function—

Slots

NameSourceDescriptionParameters / type
Dynamic named column/search slotsFast additionBusiness slots generated from column slot/headerSlot or search-field names.—

Renders inputs from FaTableColumn search configuration and triggers searching on value changes. Requires FaTable search state; do not use independently.

Props

PropertySourceDescriptionTypeDefault
columnRequiredFast additionFaTable column configuration for the current search field.Object—
searchRequiredFast additionAsynchronous search after the field value changes.Function—

Slots

NameSourceDescriptionParameters / type
Dynamic named column/search slotsFast additionBusiness slots generated from column slot/headerSlot or search-field names.—

FaTable instance methods ​

These are call snippets. Use rows, options and fields from your actual data.

clearSelection Selection ​

Clears selection in a multi-select table.

Signature ​

ts
clearSelection(): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.clearSelection();
}
</script>

Input: No parameters.

Returns: void.

getSelectionRows Selection ​

Returns currently selected rows.

Signature ​

ts
getSelectionRows(): import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow[];

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	const result = componentRef.value?.getSelectionRows();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

ValueTypeDescription
resultDefaultRow[]Method result consistent with the current component state.

getHalfSelectionRows Selection ​

Returns currently partially selected rows.

Signature ​

ts
getHalfSelectionRows(): import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow[];

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	const result = componentRef.value?.getHalfSelectionRows();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

ValueTypeDescription
resultDefaultRow[]Method result consistent with the current component state.

toggleRowSelection Selection ​

Toggles row selection in a multi-select table; the second argument explicitly sets selection.

Signature ​

ts
toggleRowSelection(row: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow, selected?: boolean, ignoreSelectable?: boolean): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
const row = { id: 1, name: "Fast" };
function handleExample() {
	componentRef.value?.toggleRowSelection(row, true, true);
}
</script>

Input ​

InputTypeRequired / defaultDescription
rowDefaultRowRequiredTarget table row data.
selectedboolean | undefinedOptionalWhether the target row is selected.
ignoreSelectableboolean | undefinedOptionalWhether to ignore selectable restrictions.

Returns ​

ValueTypeDescription
resultvoidNo return value.

toggleAllSelection Selection ​

Toggles selecting all/none in a multi-select table.

Signature ​

ts
toggleAllSelection(): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.toggleAllSelection();
}
</script>

Input: No parameters.

Returns: void.

toggleRowExpansion Expand ​

Toggles an expandable/tree-table row; the second argument explicitly expands or collapses it.

Signature ​

ts
toggleRowExpansion(row: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow, expanded?: boolean): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
const row = { id: 1, name: "Fast" };
function handleExample() {
	componentRef.value?.toggleRowExpansion(row, true);
}
</script>

Input ​

InputTypeRequired / defaultDescription
rowDefaultRowRequiredTarget table row data.
expandedboolean | undefinedOptionalWhether the target row is expanded.

Returns ​

ValueTypeDescription
resultvoidNo return value.

setCurrentRow Current ​

Sets the current row in a single-select table; omitting the argument clears highlighting.

Signature ​

ts
setCurrentRow(row?: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow | undefined): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
const row = { id: 1, name: "Fast" };
function handleExample() {
	componentRef.value?.setCurrentRow(row);
}
</script>

Input ​

InputTypeRequired / defaultDescription
rowDefaultRow | undefinedOptionalTarget table row data.

Returns ​

ValueTypeDescription
resultvoidNo return value.

clearSort Sort ​

Clears sorting and restores unsorted data.

Signature ​

ts
clearSort(): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.clearSort();
}
</script>

Input: No parameters.

Returns: void.

clearFilter Filter ​

Clears filters for columnKey entries; with no argument, clears all filters.

Signature ​

ts
clearFilter(columnKeys?: string[] | string): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.clearFilter(["name"]);
}
</script>

Input ​

InputTypeRequired / defaultDescription
columnKeysstring | string[] | undefinedOptionalColumn keys whose filters should be cleared; omit for all columns.

Returns ​

ValueTypeDescription
resultvoidNo return value.

doLayout Layout ​

Recalculates table layout, for example after visibility changes.

Signature ​

ts
doLayout(): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.doLayout();
}
</script>

Input: No parameters.

Returns: void.

sort Sort ​

Sorts the table manually using the property and order.

Signature ​

ts
sort(prop: string, order: string): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.sort("name", "ascending");
}
</script>

Input ​

InputTypeRequired / defaultDescription
propstringRequiredForm field path or table sort property.
orderstringRequiredSort direction, such as ascending or descending.

Returns ​

ValueTypeDescription
resultvoidNo return value.

scrollTo Scroll ​

Scrolls to specified coordinates.

Signature ​

ts
scrollTo(options: ScrollToOptions | number, yCoord?: number): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.scrollTo({ top: 120, behavior: "smooth" }, 1);
}
</script>

Input ​

InputTypeRequired / defaultDescription
optionsnumber | ScrollToOptionsRequiredScroll distance or standard ScrollToOptions.
yCoordnumber | undefinedOptionalVertical scroll coordinate.

Returns ​

ValueTypeDescription
resultvoidNo return value.

setScrollTop Scroll ​

Sets vertical scroll position.

Signature ​

ts
setScrollTop(top?: number): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.setScrollTop(120);
}
</script>

Input ​

InputTypeRequired / defaultDescription
topnumber | undefinedOptionalVertical scroll distance.

Returns ​

ValueTypeDescription
resultvoidNo return value.

setScrollLeft Scroll ​

Sets horizontal scroll position.

Signature ​

ts
setScrollLeft(left?: number): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
function handleExample() {
	componentRef.value?.setScrollLeft(120);
}
</script>

Input ​

InputTypeRequired / defaultDescription
leftnumber | undefinedOptionalHorizontal scroll distance.

Returns ​

ValueTypeDescription
resultvoidNo return value.

updateKeyChildren Node ​

Updates children for a key in a lazy table; requires rowKey.

Signature ​

ts
updateKeyChildren(key: string, data: import("element-plus/es/components/table/src/table/defaults.mjs").DefaultRow[]): void;

Example ​

Expand the parent in the lazy children example and click the replacement button. Pass a string row key and the replacement rows.

Input ​

InputTypeRequired / defaultDescription
keystringRequiredUnique node, row, or column identifier.
dataDefaultRow[]RequiredBusiness data to query, insert, remove, or replace.

Returns ​

ValueTypeDescription
resultvoidNo return value.

toggleRowIndeterminateSelection Selection ​

Toggles partial selection styling in a multi-select table; the second argument explicitly sets selection.

Signature ​

ts
toggleRowIndeterminateSelection(row: DefaultRow, selected?: boolean): void;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
const row = { id: 1, name: "Fast" };
function handleExample() {
	componentRef.value?.toggleRowIndeterminateSelection(row, true);
}
</script>

Input ​

InputTypeRequired / defaultDescription
rowDefaultRowRequiredTarget table row data.
selectedboolean | undefinedOptionalWhether the target row is selected.

Returns ​

ValueTypeDescription
resultvoidNo return value.

refresh Refresh ​

Asynchronously refreshes the table.

Signature ​

ts
refresh(): Promise<void>;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
async function handleExample() {
	const result = await componentRef.value?.refresh();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

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

reset Reset ​

Asynchronously resets the table.

Signature ​

ts
reset(): Promise<void>;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
async function handleExample() {
	const result = await componentRef.value?.reset();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

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

doRender Render ​

Rerenders the table, for example when TableKey changes.

Signature ​

ts
doRender(): Promise<void>;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
async function handleExample() {
	const result = await componentRef.value?.doRender();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

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

doLoading Loading ​

Runs a task with table loading state.

Signature ​

ts
doLoading(loadingFunction: () => void | Promise<void>, loadingText?: string): Promise<void>;

Example ​

vue
<template>
	<FaTable ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const componentRef = ref<InstanceType<typeof FaTable>>();
const saveData = async () => Promise.resolve();
async function handleExample() {
	const result = await componentRef.value?.doLoading(async () => saveData(), "Saving");
	console.log(result);
}
</script>

Input ​

InputTypeRequired / defaultDescription
loadingFunction() => void | Promise<void>RequiredSynchronous or asynchronous task to run while loading.
loadingTextstring | undefinedOptionalOptional loading-overlay text.

Returns ​

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

FaTableColumnsSettingDialog instance methods ​

These are call snippets. Use rows, options and fields from your actual data.

open Open ​

Opens.

Signature ​

ts
open(): Promise<void>;

Example ​

vue
<template>
	<Component ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const Component = FaTable.TableColumnsSettingDialog;
const componentRef = ref<InstanceType<typeof Component>>();
async function handleExample() {
	const result = await componentRef.value?.open();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

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

change Change ​

Handles column changes.

Signature ​

ts
change(): Promise<void>;

Example ​

vue
<template>
	<Component ref="componentRef" />
	<button type="button" @click="handleExample">Call method</button>
</template>

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

const Component = FaTable.TableColumnsSettingDialog;
const componentRef = ref<InstanceType<typeof Component>>();
async function handleExample() {
	const result = await componentRef.value?.change();
	console.log(result);
}
</script>

Input ​

This method has no input parameters.

Returns ​

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

State and lifecycle ​

Height follows the container and supplied table height, without an additional mobile minimum height. Container changes synchronize width and height, but automatic column widths are recalculated only when the width changes, so a mobile keyboard height change does not interrupt input. Card borders use the Element Plus theme.

Requests, automatic widths and doLoading own separate Loading entries. Manual false releases only its manual owner. Unmount cancels queued rendering/column tasks and settles doRender; late results cannot update state. ResizeObserver disconnects through watcher cleanup.

Expansion, selection and index columns (2.0.23) ​

FaTable owns these utility columns. Enabled columns appear in expansion, selection and index order before business columns. All three are fixed on the left, excluded from business-column settings, and participate in equal-value row merging when props.span is configured.

ConfigurationDefaultBehavior
#expandHidden when absentProviding the slot creates a 35px expansion column
selection-columnfalseEnables checkboxes; combines with single, row-click-selection and row-selectable
index-columntrueShows row numbers; set :index-column="false" to hide them

The #expand scope includes row, column, $index and the table context in FaTableDefaultSlotsResult. Expansion state still uses expand-change, expand-row-keys, default-expand-all and toggleRowExpansion.

Expansion content uses a dedicated .fa-table__expand-wrapper. The 2.0.25 source moves its styles into table.scss, uses position: sticky; left: 0 to preserve its horizontal position, and clears the default padding on the outer .el-table__expanded-cell. The wrapper uses box-sizing: border-box and width: var(--fa-table-expand-width, 100cqw). Set style="--fa-table-expand-width: 720px" on FaTable to override the width; other valid CSS widths such as calc(...) are supported. Without an override, its width follows the main container rather than the combined column width; this default does not automatically subtract table borders or native vertical scrollbar width. Padding is 12px 16px by default and 8px 12px for the small component size, so the slot usually needs no additional outer padding. Without #expand, the wrapper is not created and the main container does not enable inline-size containment.

FaTableColumnType no longer accepts selection, index or expand. When upgrading, add selection-column to tables that previously relied on default checkboxes. Remove utility columns from columns or FaTableColumn and use the table props and #expand instead. Move previous expansion render or named-slot content into #expand; <FaTableColumn type="expand"> is no longer supported.

vue
<FaTable :data="rows" selection-column :index-column="false">
	<template #expand="{ row }">
		<div>{{ row["description"] }}</div>
	</template>
	<FaTableColumn prop="name" label="Name" />
</FaTable>

Demo dependency and reviewed source

The live examples and automatic API table below use fast-element-plus 2.0.27.

Row data types ​

DefaultRow is the public default row type and permits fields not declared in advance. Extend it for known data structures and use FaTableColumnCtx<T> and PagedResult<T> for precise column and pagination types.

ts
import type { DefaultRow, FaTableColumnCtx, PagedResult } from "fast-element-plus";

interface UserRow extends DefaultRow {
	id: number;
	name: string;
}

const columns: FaTableColumnCtx<UserRow>[] = [{ prop: "name", label: "Name" }];

const result: PagedResult<UserRow> = {
	rows: [{ id: 1, name: "Fast" }],
	totalRows: 1,
};