美文网首页vueJs使用
vue+elementui table表格点击单元格单元格改变背

vue+elementui table表格点击单元格单元格改变背

作者: 记录学习生活 | 来源:发表于2020-05-27 11:40 被阅读0次

<el-table
:data="tableData"
border
@cell-click="cellclick"
:cell-style="tableCellStyle">
</el-table>

data(){
row:'',
column:''
}

cellclick (row, column, cell, event) {
this.row = row
this.column = column
},
tableCellStyle (row, rowIndex, column) {
if (this.row && this.columnName) {}
if (this.row === row.row && this.column === row.column) {
return 'background-color:#ccc;'
} else {
return 'background-color:#fff;'
}
},

来源

相关文章

网友评论

    本文标题:vue+elementui table表格点击单元格单元格改变背

    本文链接:https://www.haomeiwen.com/subject/deqwahtx.html