<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="js/vue.js"> </script>
<style>
.inner{
height:100px;
background:green;
}
</style>
</head>
<body>
<div id='app' class="inner">
<div @click='divclick'>
<!-- 事件修饰符之取消冒泡 -->
<input type='button' value='点击' @click.stop='btnclick'>
<!-- 事件修饰符之只执行一次事件 <input type='button' value='点击' @click.once='btnclick'>-->
</div>
</div>
<script>
var vm=new Vue({
el:'#app',
data:{},
methods:{
divclick(){
console.log('div');
},
btnclick(){
console.log('btn');
}
}
})
</script>
</body>
</html>