From bd6fae9aede8cb1513c3883a21afee17d7dfc8fd Mon Sep 17 00:00:00 2001 From: roymondchen Date: Fri, 25 Aug 2023 11:37:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(table):=20=E6=96=B0=E5=A2=9E=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=85=8D=E7=BD=AE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/table/src/ComponentColumn.vue | 40 ++++++++++++++++++++++++++ packages/table/src/Table.vue | 5 ++++ packages/table/src/TextColumn.vue | 2 +- packages/table/src/schema.ts | 6 ++-- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 packages/table/src/ComponentColumn.vue diff --git a/packages/table/src/ComponentColumn.vue b/packages/table/src/ComponentColumn.vue new file mode 100644 index 00000000..b0cf3ac0 --- /dev/null +++ b/packages/table/src/ComponentColumn.vue @@ -0,0 +1,40 @@ + + + diff --git a/packages/table/src/Table.vue b/packages/table/src/Table.vue index 1fccfd74..0f02e016 100644 --- a/packages/table/src/Table.vue +++ b/packages/table/src/Table.vue @@ -25,6 +25,10 @@ + + - 扩展配置 + {{ config.buttonText || '扩展配置' }} string); + type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: any) => string); text?: string; prop?: string; showHeader?: boolean; @@ -58,8 +58,10 @@ export type ColumnConfig = { handler?: (row: any) => void; /** 当type为expand时有效,展开为html */ expandContent?: (row: any, prop?: string) => string; - /** 当type为expand时有效,展开为vue组件 */ + /** 当type为expand时,展开为vue组件;当type为component时显示的组件 */ component?: any; /** 当type为expand时有效,展开的vue组件props */ props?: any; + /** 当type为tip时有效,显示文案 */ + buttonText?: string; };