vue访问原生 DOM 事件
<body> <div id="test"> <button @click="changeColor('你好',$event)">点击我</button> <div style="height: 100px;width: 100px;" @mouseover="over('鼠标从我上面滑过',$event)"> </div> </div> <script type="text/javascript"> var myVue = new Vue({ el: '#test', methods: { //这里使用methods changeColor: function (message, event) { alert(message+event); //弹出我被点击了,事件是[object MouseEvent] }, over :function (message, event) { alert(message+event); //弹出鼠标从我上面滑过,事件是[object MouseEvent] } } }) </script> </body>