1. 去掉浏览器默认事件,添加自定义事件
@contextmenu.prevent="show()" //show 为自定义事件
上代码:
<button type="button" class="btn btn-primary" @contextmenu.prevent="show()">保存</button>
自定义方法:
methods:{
show:function(){
alert("触发了右击事件");
},
}
Ok!!!
1. 去掉浏览器默认事件,添加自定义事件
@contextmenu.prevent="show()" //show 为自定义事件
上代码:
<button type="button" class="btn btn-primary" @contextmenu.prevent="show()">保存</button>
自定义方法:
methods:{
show:function(){
alert("触发了右击事件");
},
}
Ok!!!