<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>事件绑定</title>
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
<h2>{{name}}</h2>
<button v-on:click="showInfo">点击我,显示Vue点击事件</button>
<!-- v-on:click == @click -->
</div>
<script type="text/javascript">
Vue.config.productionTip = false;

const vm = new Vue({
el:'#root',
data:{
name:'虾米大王'
},
methods:{
showInfo(event){
console.log(event.target.innerText); //可以接收event参数
console.log(this === vm); // this对象就是vm实例
//alert('点击了我,显示提示');
}
}
})


</script>
</body>
</html>