通过 Scoped slot
可以获取到 row, column, $index 和 store(table 内部的状态管理)的数据:
<template slot-scope="{ row }">
<el-button size="small" type="success">分配权限</el-button>
<el-button
size="small"
type="primary"
@click="editRole(row.id)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="deleteRole(row.id)"
>删除</el-button
>
</template>
row中可以获取每一行传入的数据。