element-UI 如果获取表格当前行

表格获取当前行的方法,参考element-UI文档上,可以使用作用域插槽获取当前行的数据

 // 通过 slot-scope 可以获取到 row, column, $index 和 store(table 内部的状态管理)的数据 参数需要解构
<template slot-scope="{ row }">
                  <el-button size="small" type="success">分配权限</el-button>
                  <el-button size="small" type="primary">编辑</el-button>
                  <el-button size="small" type="danger" @click="delRole(row.id)">删除</el-button>
 </template>

  // 上面通过 button 按钮事件监听 获得到想要的数据 从而进行删除

 

posted @ 2022-03-26 21:44  行8  阅读(1718)  评论(0)    收藏  举报