submenu closes when click outside
This commit is contained in:
@ -34,6 +34,7 @@ export const globalStore = defineStore("globalStore", {
|
||||
draw2dLast: false,
|
||||
reset: false,
|
||||
canDraw: true,
|
||||
activeSubMenu: "",
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
@ -46,14 +47,17 @@ export const globalStore = defineStore("globalStore", {
|
||||
);
|
||||
},
|
||||
toggleDraw1d() {
|
||||
this.setActiveSubMenu("");
|
||||
this.draw1d = true;
|
||||
},
|
||||
toggleDraw2d() {
|
||||
this.setActiveSubMenu("");
|
||||
this.toggleStop();
|
||||
this.canDraw = true;
|
||||
this.draw2d = true;
|
||||
},
|
||||
toggleDraw2dLast() {
|
||||
this.setActiveSubMenu("");
|
||||
this.toggleStop();
|
||||
this.canDraw = true;
|
||||
this.draw2dLast = true;
|
||||
@ -68,5 +72,9 @@ export const globalStore = defineStore("globalStore", {
|
||||
this.draw2dLast = false;
|
||||
this.canDraw = false;
|
||||
},
|
||||
setActiveSubMenu(data) {
|
||||
if (this.activeSubMenu == data) this.activeSubMenu = "";
|
||||
else this.activeSubMenu = data;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user