element-ui 點擊獲取table的行索引
阿新 • • 發佈:2018-12-21
ble delete bsp -name order current table owin index
}
}
<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);
}
找資料找到的別人提供的方法,記錄一下
element-ui 點擊獲取table的行索引