Vue disables the left mouse button click event and the right button of the scroll wheel is still available.

I'm too lazy to explain directly to the code. . . . The main code
Insert image description here
of the bound class
Insert image description here
Insert image description here

<div class="main-51world" id="map_51world"
         @mousedown="preventEvent($event)" @mouseup="is51Disabled=false"
    >
      <div id="player" :class="{
     
     'is51Disabled':is51Disabled}"></div>
    </div>


.is51Disabled {
  pointer-events: none
}
`

 preventEvent(e) {
      //console.log('e========'+e.button)
      switch (e.button) {
        case 0:
          this.is51Disabled =true
          break
      }
    }``

Guess you like

Origin blog.csdn.net/TY_GYY/article/details/125628499