慕函数3515900
2018-08-01 15:23
computed:{
count(){
return this.todos.filter(todo => !todo.completed).length;
}
},
filter起过滤作用,只有满足“todo => !todo.completed”,即当completed===false时,这个todo才会保存到filter方法的返回值中,这是我的理解。
Vue+Webpack打造todo应用
84621 学习 · 812 问题
相似问题