<!DOCTYPE html>标签:el,vue,false,name,js,点击,Vue,021,methods From: https://blog.51cto.com/u_15356972/6085194
<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>
</div>
<script type="text/javascript">
Vue.config.productionTip = false;
new Vue({
el:'#root',
data:{
name:'虾米大王'
},
methods:{
showInfo(){
alert('点击了我,显示提示');
}
}
})
</script>
</body>
</html>