|
@@ -109,6 +109,7 @@ export default {
|
|
|
},
|
|
|
componentRemarkObj: {
|
|
|
type: Object,
|
|
|
+ default: () => ({}),
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
@@ -133,6 +134,7 @@ export default {
|
|
|
left: rect.left,
|
|
|
top: rect.top,
|
|
|
};
|
|
|
+ window.addEventListener('mousedown', this.handleMouseDown);
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
@@ -290,6 +292,15 @@ export default {
|
|
|
this.componentId,
|
|
|
);
|
|
|
},
|
|
|
+ handleMouseDown(event) {
|
|
|
+ if (event.button === 0) {
|
|
|
+ // 0 表示左键
|
|
|
+ this.showMenu = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ window.removeEventListener('mousedown', this.handleMouseDown);
|
|
|
},
|
|
|
};
|
|
|
</script>
|