用template写的单元格 <el-table-column fixed="right" label="操作" width="100"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row,scope.column, scope.$index)" type="text" size="small">查看</el-button> <el-button type="text" size="small">编辑</el-button> </template> </el-table-column> 方法 handleClick(row,col,index) { console.log(row,col,index); } 也就是scope里面包括这一行,这一列和索引的数据
用template写的单元格
方法
也就是scope里面包括这一行,这一列和索引的数据