vue2.0+基础知识连载(07)--- 事件对象
2018-01-19 12:04
671 查看
<!DOCTYPE html> <html> <head> <title>vue2.0+基础知识连载(07)--- 事件对象</title> </head> <body> <h3>vue2.0+基础知识连载(07)--- 事件对象</h3> <div id='app'> <input type="button" value="按钮" @click="show(12,$event)"> <input type="button" value="按钮2" @click="show($event,12)"> </div> <script src="https://cdn.bootcss.com/vue/2.5.8/vue.min.js"></script> <script type="text/javascript"> var vm = new Vue({ data: {}, methods: { show: function(ev, b) { alert(ev); alert(ev.clientX); alert(b); console.log(ev); console.log(ev.clientX); console.log(b); } } }).$mount('#app'); </script> </body> </html>
相关文章推荐
- vue2.0+基础知识连载(09)--- 默认事件
- vue2.0+基础知识连载(10)--- 键盘事件
- vue2.0+基础知识连载(17)--- 路由
- vue2.0+基础知识连载(01)--- Vue实例简介
- vue2.0+基础知识连载(18)--- 动画(transition)
- vue2.0+基础知识连载(03)--- 常用属性介绍
- vue2.0+基础知识连载(19)--- 自定义指令
- vue2.0+基础知识连载(20)--- 自定义键盘信息
- vue2.0+基础知识连载(05)--- 绑定class样式
- vue2.0+基础知识连载(11)--- 生命周期
- vue2.0+基础知识连载(12)--- 监听数据变化
- vue2.0+基础知识连载(04)--- 绑定style样式
- vue2.0+基础知识连载(13)--- 计算属性的使用
- vue2.0+基础知识连载(14)--- 局部组件与全局组件
- vue2.0+基础知识连载(16)--- 非父子组件通信
- Vue 2.0入门基础知识之内部指令详解
- vue-router 2.0 常用基础知识点之router.push()
- vue-router 2.0 常用基础知识点之router-link
- SEO基础知识8大精华文章之第五篇 SEO运用的市场对象(连载)
- vue-router 2.0 常用基础知识点之router.push()