onClick时调用onDoubleClick()方法:
this.count=0;
onDoubleClick() {
// 双击
if (e.node.props.eventKey.indexOf('-') > -1) {
this.count += 1;
setTimeout(() => {
this.count === 2 && this.doSomething(e);//双击
this.count = 0;
}, 200);
}
}
只这样写能起到双击的作用,但是不好使,可以用css使双击时不选中文字。样式如下:
.style{
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-ms-user-select: none;
}