vue是怎样处理 冒泡事件和默认事件的

<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
window.onload=function(){

new Vue({
el:'#app',

    • data:{

},

methods:{
xixida: function(ev){
alert(1);
ev.preventDefault=true;//阻止默认事件(原生方法)
ev.stop;//阻止冒泡(原声方法)
}
}
});//

}

</script>
<body>
<div id="app">
<input type="button" value="按钮" @click.stop="xixida" /> //阻止默认事件 vue方法
<input type="button" value="按钮" @contextmenu.prevent="xixida" /> //阻止冒泡

</div>

原文地址:https://www.cnblogs.com/zhangxiaofei/p/6634869.html