mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-12 09:12:28 +08:00
Table组件columns增加泛型
This commit is contained in:
@@ -4,7 +4,7 @@ import { provide, inject, ComputedRef } from 'vue';
|
||||
|
||||
const key = Symbol('s-table');
|
||||
|
||||
type Instance = TableActionType & {
|
||||
type Instance = TableActionType<{}> & {
|
||||
wrapRef: Ref<Nullable<HTMLElement>>;
|
||||
getBindValues: ComputedRef<Recordable>;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
|
||||
import { ComponentType } from './componentType';
|
||||
export interface BasicColumn extends TableBaseColumn {
|
||||
export interface BasicColumn<T> extends TableBaseColumn<T> {
|
||||
//编辑表格
|
||||
edit?: boolean;
|
||||
editRow?: boolean;
|
||||
@@ -13,16 +13,16 @@ export interface BasicColumn extends TableBaseColumn {
|
||||
// 权限编码控制是否显示
|
||||
auth?: string[];
|
||||
// 业务控制是否显示
|
||||
ifShow?: boolean | ((column: BasicColumn) => boolean);
|
||||
ifShow?: boolean | ((column: BasicColumn<T>) => boolean);
|
||||
// 控制是否支持拖拽,默认支持
|
||||
draggable?: boolean;
|
||||
}
|
||||
|
||||
export interface TableActionType {
|
||||
export interface TableActionType<T> {
|
||||
reload: (opt) => Promise<void>;
|
||||
emit?: any;
|
||||
getColumns: (opt?) => BasicColumn[];
|
||||
setColumns: (columns: BasicColumn[] | string[]) => void;
|
||||
getColumns: (opt?) => BasicColumn<T>[];
|
||||
setColumns: (columns: BasicColumn<T>[] | string[]) => void;
|
||||
}
|
||||
|
||||
export interface BasicTableProps {
|
||||
|
||||
Reference in New Issue
Block a user