<div id="app7"> <div style="height: 80px;width: 80px;background-color: aquamarine;" @click="father"> <div style="height: 40px;width: 40px;background-color: bisque;" @click="son"></div> </div> </div> <script> const app7=new Vue({ el:'#app7', data:{}, methods:{ father(){ console.log("父亲被点击") }, son(e){ e.stopPropagation() console.log('儿子被点击') } } }) </script>
标签:el,vue,console,log,app7,学习,点击 From: https://www.cnblogs.com/cocotun/p/17777422.html