Optimize Tabs contextMenu
This commit is contained in:
parent
e3d2e05598
commit
0a3ea18b48
1 changed files with 15 additions and 12 deletions
|
@ -332,6 +332,8 @@
|
||||||
this.$emit('on-dblclick', nav.name);
|
this.$emit('on-dblclick', nav.name);
|
||||||
},
|
},
|
||||||
handleContextmenu (index, event) {
|
handleContextmenu (index, event) {
|
||||||
|
if (this.contextMenuVisible) this.handleClickContextMenuOutside();
|
||||||
|
this.$nextTick(() => {
|
||||||
const nav = this.navList[index];
|
const nav = this.navList[index];
|
||||||
if (!nav || nav.disabled || !nav.contextMenu) return;
|
if (!nav || nav.disabled || !nav.contextMenu) return;
|
||||||
|
|
||||||
|
@ -345,6 +347,7 @@
|
||||||
this.contextMenuStyles = position;
|
this.contextMenuStyles = position;
|
||||||
this.contextMenuVisible = true;
|
this.contextMenuVisible = true;
|
||||||
this.$emit('on-contextmenu', nav, event, position);
|
this.$emit('on-contextmenu', nav, event, position);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleClickContextMenuOutside () {
|
handleClickContextMenuOutside () {
|
||||||
this.contextMenuVisible = false;
|
this.contextMenuVisible = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue