比如说,鼠标移动到其中一行,该行上边显示双击打开详细内容。这该怎么做呢?
回答
通过cell-mouse-enter和cell-mouse-leave实现,参考下:
{{ scope.row.date }}
姓名: {{ scope.row.name }}
住址: {{ scope.row.address }}
{{ scope.row.name }}
编辑
删除
export default {
name: "app",
data() {
return {
tableData: [
{
id: 1,
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄"
},
{
id: 2,
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1517 弄"
},
{
id: 3,
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1519 弄"
},
{
id: 4,
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1516 弄"
}
]
};
},
methods: {
handleEdit(index, row) {
console.log(index, row);
},
handleDelete(index, row) {
console.log(index, row);
},
enter(row, column, cell) {
console.log(row)
this.$refs['popover'+row.id].showPopper = true
},
leave(row,column,cell) {
this.$refs['popover'+row.id].showPopper = false
}
}
};