UA-Compatible" content="IE=edge">
.Odiv1{
width: 80px;
height: 80px;
background: #aaa;
margin: 5px;
}
.Odiv2{
width: 50px;
height: 50px;
background: #ccc;
}
var vm = new Vue({
el: '#app',
data: {
count: 0
},
methods: {
inc(e){
this.count++;
// 通过事件对象的target属性获取真正引起该事件的那个网页标签
console.log(e.target.tagName)
},
dec(e){
this.count--;
console.log(e.target.tagName)
},
handleKey(e){
console.log('键盘被敲击了');
console.log('用户敲击了'+e.key);
// if(e.key=='Enter'){
// alert('通过测试')
// }
alert('通过测试')
},
handleSave(){
console.log('shift+s组合键被敲击了');
},
doParent(){
console.log("我是父元素单击事件");
},
doThis(){
console.log("我是当前元素的单击事件");
}
}
})