Click event execution of div on the outermost layer of vue and how to prevent other click events from being executed


whether the click event in the blue area causes the pop-up window in the upper right corner to close
the outermost click event adds the anti-bubbling behavior touchstart.stop= "closeMenu" or does not work by clicking on the blue area to close the pop-up window in the upper right corner and the click event in the lower layer at the same time. How should it be stopped?

Jun.30,2022

@ click.capture.stop


idea:
bind events on the outermost div Note that menus cannot be included in this div
menu status open = true; Click the non-menu part to close the menu open = false; to block capture at this time;
menu status open = false; do nothing at this time

do something like this:

<div @click.capture = myClick($event)></div>
//.capture 

js:
myClick:(event){
    if(this.open){
        event.preventDefault();//stop 
        this.open = false;//
    }
}
Menu