element UI cell-click用法
element UI官网链接:表格部分<el-table:data="tableData"@cell-click="cellHandleclick"//当某个单元格被点击时会触发该事件@row-click="rowHandleclick">methods: {cellHandleclick(row, column, cell, event) {console.log(row);cons
·
element UI官网链接:表格部分
<el-table
:data="tableData"
@cell-click="cellHandleclick" //当某个单元格被点击时会触发该事件
@row-click="rowHandleclick"
>
methods: {
cellHandleclick(row, column, cell, event) {
console.log(row);
console.log(column);
console.log(cell);
console.log(event);
//如果规定点击某一列执行,利用column中的label属性
if(column.label === '某一列名称') {
//执行逻辑
}
}
//如果想规定点击某一行执行
rowHandleclick(row, column, event){
//执行逻辑
}
}
更多推荐
已为社区贡献10条内容
所有评论(0)