签入版本
This commit is contained in:
@@ -92,12 +92,12 @@ const [register, { getFieldsValue }] = useForm({
|
||||
:row-key="(row) => row.id"
|
||||
ref="tableRef"
|
||||
:actionColumn="actionColumn"
|
||||
@selection-change="onSelectionChange"
|
||||
@update:checked-row-keys="onCheckedRow"
|
||||
>
|
||||
<template #tableTitle>
|
||||
<el-button type="primary" @click="handleAdd" v-perm="['sys:example:add']">
|
||||
<n-button type="primary" @click="handleAdd" v-perm="['sys:example:add']">
|
||||
添加案例演示
|
||||
</el-button>
|
||||
</n-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</template>
|
||||
@@ -119,13 +119,22 @@ const loadDataTable = (params) => getExamplePage(params);
|
||||
### 行操作列(TableAction)
|
||||
|
||||
```typescript
|
||||
import { h } from 'vue';
|
||||
import { TableAction } from '@/components/Table';
|
||||
|
||||
const actionColumn = {
|
||||
width: 200,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
actions: [
|
||||
{ label: '编辑', type: 'info', onClick: () => handleEdit(record), auth: ['sys:example:update'] },
|
||||
{ label: '删除', type: 'error', onClick: () => handleDelete(record), auth: ['sys:example:delete'] },
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user