<!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 @click.once="showInfo">点击我,事件仅执行一次</button>


</div>
<script type="text/javascript">
Vue.config.productionTip = false;

const vm = new Vue({
el:'#root',
data:{
name:'虾米大王'
},
methods:{
showInfo(){

alert('点击了我,显示提示');

}
}
})


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