赞
踩
参考官方文档 Element - The world's most popular Vue UI framework
如下,使用属性 row-class-name
- <el-table
- :data="tableData"
- style="width: 100%"
- :row-class-name="tableRowClassName">
- <el-table-column
- label="操作">
- <template slot-scope="scope">
- <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
- </template>
- </el-table-column>
- </el-table>
-
- tableRowClassName ({ row, rowIndex }) {
- row.rowIndex = rowIndex;
- },
- handleClick (row){
- console.log(row.rowIndex) //行号索引值
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。