OperationColumn 操作列
自动生成表格操作按钮的组件。
基本用法
vue
<template>
<el-table :data="tableData">
<el-table-column label="操作">
<template #default="{ row }">
<OperationColumn
:buttons="buttons"
:row="row"
@click="handleClick"
/>
</template>
</el-table-column>
</el-table>
</template>
<script setup lang="ts">
const buttons = [
{ text: '编辑', type: 'primary' },
{ text: '删除', type: 'danger' }
]
function handleClick(button: any, row: any) {
console.log(button, row)
}
</script>Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| buttons | 按钮配置 | Array | [] |
| row | 行数据 | object | - |
