element-ui 点击获取table的行索引

 <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading..."  border fit
:row-class-name="tableRowClassName"
@row-click = "onRowClick"

highlight-current-row style="width: 100%">
<el-table-column align="center" prop="passtime" label="Time" width="180">

tableRowClassName ({row, rowIndex}) {
//把每一行的索引放进row
row.index = rowIndex;
},
onRowClick (row, event, column) {
//行点击消除new标记
var index = row.index;
var deleteIndex = Array.indexOf(this.showIndexArr, index);
if (deleteIndex != -1) {
this.showIndexArr.splice(deleteIndex,1);
}
}

找资料找到的别人提供的方法,记录一下

上一篇:android下apkplug通用主题(皮肤)切换解决方案之主应用-01


下一篇:CentOS5.5下安装Ant