Vue はマウスの左ボタンのクリック イベントを無効にしますが、スクロール ホイールの右ボタンは引き続き使用できます。

コードを直接説明するのは面倒です。
ここに画像の説明を挿入します
バインドされたクラスの
ここに画像の説明を挿入します
ここに画像の説明を挿入します
メインコード

<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
      }
    }``

おすすめ

転載: blog.csdn.net/TY_GYY/article/details/125628499