鼠标移入、移出分别用 @mouseenter 和 @mouseleave
<el-table-column min-width="60" align="center" label="操作">
<template scope="{row, column, $index}">
<ss-tip-icon @mouseenter.native="showDetailClick(row,$event);" @mouseleave.native="hiddenDetailClick(row);" :iconType="row.detailIcon?row.detailIcon:'detail'" tooltip="详情"></ss-tip-icon>
</template>
</el-table-column>
methods
hiddenDetailClick(row){
this.showDetailFlag = false;
this.showDetail = [];
row.detailIcon = "detail";
},
showDetailClick(row, e){
let _row = row;
let proofno = _row.proofno;
this.showDetail = Object.assign({}, _row);
this.showDetailFlag = true;
_row.detailIcon = "detailHover";
_row.proofno = proofno+" ";
this.x = e.clientX-600;
this.y = e.clientY;
this.$nextTick(() => {
let x = this.$util.getAbsoluteLeft(this.$refs.childsTab.$el);
let y = this.$util.getAbsoluteTop(this.$refs.childsTab.$el);
if(this.y > y){
this.y = y;
}
})
}