feat: 【ele】增加 TableAction 组件
This commit is contained in:
36
apps/web-ele/src/components/table-action/typing.ts
Normal file
36
apps/web-ele/src/components/table-action/typing.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { ButtonProps } from 'element-plus';
|
||||
|
||||
export type ButtonType =
|
||||
| 'danger'
|
||||
| 'default'
|
||||
| 'info'
|
||||
| 'primary'
|
||||
| 'success'
|
||||
| 'text'
|
||||
| 'warning';
|
||||
|
||||
export interface PopConfirm {
|
||||
title: string;
|
||||
okText?: string;
|
||||
cancelText?: string;
|
||||
confirm: () => void;
|
||||
cancel?: () => void;
|
||||
icon?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface ActionItem extends Partial<ButtonProps> {
|
||||
onClick?: () => void;
|
||||
type?: ButtonType;
|
||||
label?: string;
|
||||
color?: 'error' | 'success' | 'warning';
|
||||
icon?: string;
|
||||
popConfirm?: PopConfirm;
|
||||
disabled?: boolean;
|
||||
divider?: boolean;
|
||||
// 权限编码控制是否显示
|
||||
auth?: string[];
|
||||
// 业务控制是否显示
|
||||
ifShow?: ((action: ActionItem) => boolean) | boolean;
|
||||
tooltip?: string | { [key: string]: any; content?: string };
|
||||
}
|
||||
Reference in New Issue
Block a user