import { h } from 'vue'; import { Tag } from 'ant-design-vue'; export const columns = [ { title: '菜单名称', dataIndex: 'name', key: 'name', }, { title: '类型', dataIndex: 'type', key: 'type', customRender({ record }) { return h( Tag, { color: record.type ==1 ? 'success' : 'processing', }, { default: () => (record.type ==1 ? '按钮' : '菜单'), }, ); }, }, { title: '图标', dataIndex: 'icon2', key: 'icon2', }, { title: '权限标识', dataIndex: 'permission', key: 'permission', }, { title: '状态', dataIndex: 'status', key: 'status', customRender(row) { return h( Tag, { color: row.record.status ==0 ? 'processing' : 'error', }, { default: () => (row.record.status ==0 ? '正常' : '停用'), }, ); }, }, { title: '是否隐藏', dataIndex: 'type', key: 'type', customRender({ record }) { return h( Tag, { color: record.hide ==0 ? 'success' : 'error', }, { default: () => (record.hide ==0 ? '显示' : '隐藏'), }, ); }, }, { title: '排序', dataIndex: 'sort', key: 'sort', }, { title: '更新时间', dataIndex: 'updateTime', key: 'updateTime', }, { title: '操作', width:200, fixed: 'right', key: 'action', dataIndex:'action' }, ];