通过插槽拿到每一行的全部数据
<el-table-column prop="操作" label="详情">
<template slot-scope="scope">
<el-button
type="success"
circle
size="mini"
:title="'详情'"
@click="show(scope)"
></el-button>
</template>
</el-table-column>
控制台打印结果
show(scope) {
console.log(scope);
},
打印结果如下图所示
如果想要拿到每一行的index值可以使用一下方法
show(scope) {
console.log(scope.$index);
},
打印结果就是该行的index值