mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-23 02:15:10 +08:00
style(table): 完善ts定义
This commit is contained in:
parent
523545ec7e
commit
38145ff461
@ -33,7 +33,7 @@ export interface ColumnActionConfig {
|
|||||||
action?: (data: { data: any }) => void;
|
action?: (data: { data: any }) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ColumnConfig = {
|
export interface ColumnConfig<T = any> {
|
||||||
form?: FormConfig;
|
form?: FormConfig;
|
||||||
rules?: any;
|
rules?: any;
|
||||||
values?: FormValue;
|
values?: FormValue;
|
||||||
@ -43,12 +43,12 @@ export type ColumnConfig = {
|
|||||||
fixed?: 'left' | 'right' | boolean;
|
fixed?: 'left' | 'right' | boolean;
|
||||||
width?: number | string;
|
width?: number | string;
|
||||||
actions?: ColumnActionConfig[];
|
actions?: ColumnActionConfig[];
|
||||||
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: any) => string);
|
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: T) => string);
|
||||||
text?: string;
|
text?: string;
|
||||||
prop?: string;
|
prop?: string;
|
||||||
showHeader?: boolean;
|
showHeader?: boolean;
|
||||||
table?: ColumnConfig[];
|
table?: ColumnConfig[];
|
||||||
formatter?: 'datetime' | ((item: any, row: Record<string, any>) => any);
|
formatter?: 'datetime' | ((item: any, row: T) => any);
|
||||||
popover?: {
|
popover?: {
|
||||||
placement: string;
|
placement: string;
|
||||||
width: string;
|
width: string;
|
||||||
@ -57,9 +57,9 @@ export type ColumnConfig = {
|
|||||||
};
|
};
|
||||||
sortable?: boolean | 'custom';
|
sortable?: boolean | 'custom';
|
||||||
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
||||||
handler?: (row: any) => void;
|
handler?: (row: T) => void;
|
||||||
/** 当type为expand时有效,展开为html */
|
/** 当type为expand时有效,展开为html */
|
||||||
expandContent?: (row: any, prop?: string) => string;
|
expandContent?: (row: T, prop?: string) => string;
|
||||||
/** 当type为expand时,展开为vue组件;当type为component时显示的组件 */
|
/** 当type为expand时,展开为vue组件;当type为component时显示的组件 */
|
||||||
component?: any;
|
component?: any;
|
||||||
/** 当type为expand时,展开的vue组件props;当type为component时显示的组件的props */
|
/** 当type为expand时,展开的vue组件props;当type为component时显示的组件的props */
|
||||||
@ -68,4 +68,4 @@ export type ColumnConfig = {
|
|||||||
listeners?: any;
|
listeners?: any;
|
||||||
/** 当type为tip时有效,显示文案 */
|
/** 当type为tip时有效,显示文案 */
|
||||||
buttonText?: string;
|
buttonText?: string;
|
||||||
};
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user