Files
naive-ui-admin/types/tableColumn.d.ts
2021-07-07 10:26:14 +08:00

28 lines
911 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ColumnProps, TableProps } from 'ant-design-vue/lib/table/interface'
declare global {
interface ActionOptions {
type: 'select' | 'button' | 'text' | 'popconfirm' // 控制类型默认为a,可选: select | button | text
text: string
permission?: {
// 权限
action?: 'create' | 'delete' | 'update' | 'retrieve' // CRUD权限创建Create、更新Update、读取Retrieve和删除Delete操作
effect?: 'disabled'
}
props?: any // 组件属性v-bind="props"
func?: ({ text, record, index }, callback: (...rest) => any) => any // 动作事件触发回调
}
interface TableColumn extends ColumnProps {
title: string
dataIndex: string
width?: number
slots?: {
customRender: string
}
slotsType?: 'format' | 'link' | 'component'
slotsFunc?: (...rest) => any
actions?: ActionOptions[]
}
}