Skip to content

Commit

Permalink
Changes in ContextMenuCloak.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunima22 committed Mar 4, 2025
1 parent 0b739b1 commit c534a22
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
return !this.disabled && this.currentContextMenu === this._uid;
},
},
mounted() {
document.addEventListener('click', this.hideMenu);
},
beforeDestroy() {
document.removeEventListener('click', this.hideMenu);
},
methods: {
...mapMutations('contextMenu', { setMenu: 'SET_CONTEXT_MENU' }),
showMenu(e) {
Expand All @@ -44,12 +50,7 @@
},
extendSlot,
},
mounted() {
document.addEventListener('click', this.hideMenu);
},
beforeDestroy() {
document.removeEventListener('click', this.hideMenu);
},
render() {
if (this.disabled) {
return this.extendSlot('default');
Expand Down

0 comments on commit c534a22

Please sign in to comment.