From 38145ff46199ab53331fb2de48f57d61211850e0 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 13 Mar 2024 19:55:45 +0800 Subject: [PATCH] =?UTF-8?q?style(table):=20=E5=AE=8C=E5=96=84ts=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/table/src/schema.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/table/src/schema.ts b/packages/table/src/schema.ts index a52579b3..91621ab4 100644 --- a/packages/table/src/schema.ts +++ b/packages/table/src/schema.ts @@ -33,7 +33,7 @@ export interface ColumnActionConfig { action?: (data: { data: any }) => void; } -export type ColumnConfig = { +export interface ColumnConfig { form?: FormConfig; rules?: any; values?: FormValue; @@ -43,12 +43,12 @@ export type ColumnConfig = { fixed?: 'left' | 'right' | boolean; width?: number | string; actions?: ColumnActionConfig[]; - type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: any) => string); + type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: T) => string); text?: string; prop?: string; showHeader?: boolean; table?: ColumnConfig[]; - formatter?: 'datetime' | ((item: any, row: Record) => any); + formatter?: 'datetime' | ((item: any, row: T) => any); popover?: { placement: string; width: string; @@ -57,9 +57,9 @@ export type ColumnConfig = { }; sortable?: boolean | 'custom'; action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag'; - handler?: (row: any) => void; + handler?: (row: T) => void; /** 当type为expand时有效,展开为html */ - expandContent?: (row: any, prop?: string) => string; + expandContent?: (row: T, prop?: string) => string; /** 当type为expand时,展开为vue组件;当type为component时显示的组件 */ component?: any; /** 当type为expand时,展开的vue组件props;当type为component时显示的组件的props */ @@ -68,4 +68,4 @@ export type ColumnConfig = { listeners?: any; /** 当type为tip时有效,显示文案 */ buttonText?: string; -}; +}