feat(form): table支持rowkey配置

This commit is contained in:
roymondchen 2022-11-25 17:31:49 +08:00
parent 830c8d8747
commit ea8b863694
3 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@
v-if="model[modelName]" v-if="model[modelName]"
ref="tMagicTable" ref="tMagicTable"
style="width: 100%" style="width: 100%"
:row-key="config.rowKey || 'id'"
:data="data" :data="data"
:border="config.border" :border="config.border"
:max-height="config.maxHeight" :max-height="config.maxHeight"

View File

@ -633,6 +633,7 @@ export interface TableConfig extends FormItem {
enableFullscreen?: boolean; enableFullscreen?: boolean;
fixed?: boolean; fixed?: boolean;
itemExtra?: string | FilterFunction; itemExtra?: string | FilterFunction;
rowKey: string;
} }
export interface GroupListConfig extends FormItem { export interface GroupListConfig extends FormItem {

View File

@ -9,7 +9,7 @@
:max-height="bodyHeight" :max-height="bodyHeight"
:default-expand-all="defaultExpandAll" :default-expand-all="defaultExpandAll"
:border="hasBorder" :border="hasBorder"
:row-key="rowkeyName || 'c_id'" :row-key="rowkeyName || 'id'"
:tree-props="{ children: 'children' }" :tree-props="{ children: 'children' }"
:empty-text="emptyText || '暂无数据'" :empty-text="emptyText || '暂无数据'"
:span-method="objectSpanMethod" :span-method="objectSpanMethod"