表格獲取當前行的方法,參考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 按鈕事件監聽 獲得到想要的數據 從而進行刪除
