/* 默认事件触发顺序:冒泡 vue事件修饰符 1.阻止事件传播--事件.stop 2.事假捕获--事件.capture 3.阻止事件默行为--事件.prevent 4.事件只触发一次--事件.once 5.只在点击自身是触发--事件.self */
<html> <head> <title>vue事件</title> <meta charset="utf-8"> </head> <body> <div id="app"> <div @click.capture="parent">1 <div @click="child">2 <div @click="gradson">3 </div> </div> </div> </div> </body> <script src="node_modulesvuedistvue.js"></script> <script> let vm =new Vue({ el:"#app", methods:{ parent(){alert(1)}, child(){alert(2)}, gradson(){alert(3)} } }); </script> </html>