vue事件
?
methods:{ //存放事件 }
directives:{ //自定義指令 }
computed:{ //計(jì)算屬性 ?}
?
methods:{ //存放事件 }
/*
addTodo:function (ev) { //添加任務(wù)//向list中添加任務(wù) 格式是對(duì)象
//事件對(duì)象 13 enter this指向跟實(shí)例
if( ev.keyCode === 13 ){
this.list.push({
title:ev.target.value
});
}
} */
//事件修飾符:不需要處理dom的細(xì)節(jié),例如:阻止冒泡,取消默認(rèn)行為,判斷按鍵
// v-on:eventName
/*
* 修飾符 .stop .prevent .capture .self .once
* 按鍵修飾符 .enter .tab .delete .esc
* .space .up .down .left .right
* .ctrl .alt .shift .meta 鍵值
* */
addTodo:function (date,ev) {
console.log(date,ev)
// this.list.push({
// title:ev.target.value
// })
this.list.push({
title:this.todo
});
this.doto = ""; //清空
},
轉(zhuǎn)載于:https://www.cnblogs.com/x-hui/p/6485058.html
總結(jié)
- 上一篇: MapReduce实例(数据去重)
- 下一篇: 一次基于Vue.Js的用户体验优化 (v