1.element中复制表格组件
<el-table-column prop="state" label="状态" show-overflow-tooltip>
<template slot-scope="scope">
<el-switch v-model="scope.row.state" active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
其中表格组件中的 prop中绑定的是表中的 按钮字段
然后在表格中插入插槽
template slot-scope='scope'
2.复制表单中的状态按钮
v-model绑定的是scope.row.数据库状态的字段名
就渲染好啦
修改的话 给按钮加点击事件去修改状态就好啦