增加 进行中 {{aa.title}}删除 已完成 {{aa.title}}删除 export default { data(){ return{ ok:true, todo:'', list:[ { title:"123", checked:true }, { title:"456", checked:false }, ] } }, methods:{ doadd(e){ // this.list.push(this.todo) console.log(e.keyCode) if(e.keyCode==13){ this.list.push({ title:this.todo, checked:false }) } this.todo='' }, dodel(key){ // alert(key) this.list.splice(key,1) } }} #app { font-family: 'Avenir', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px;}
|