1. 1 way to prevent the event from bubbling
There follows a click event tag and his son
call stopPropagation in subclasses () method to pass the event of ban
boxClick:function () {
alert("父标签被点击");
},
subClick:function (event) {
event.stopPropagation();
alert("子标签被点击了");
}
2. stop the event bubbling mode 2
Directly behind the event can stop the corresponding tag plus
<div class="box" @click="boxClick()">
<div class="subClass" @click.stop="subClick($event)"></div>
</div>