课程
/前端开发
/前端工具
/Vue+Webpack打造todo应用
todo => completed === todo.completed这是什么写法
2019-02-26
源自:Vue+Webpack打造todo应用 3-4
正在回答
电子版
ES6的箭头函数,需要好好看了哦。
推荐阮老师的电子版ES6
function (todo) { return completed === todo.completed ; }
箭头函数
相当于:
function (todo) { return completed === todo.completed}
语法糖
todos.filter(function(todo){ return completed === todo.completed})
举报
用前端最热门框架Vue+最火打包工具Webpack打造todo应用
3 回答this.todos.filter(todo => completed === todo.completed)
1 回答 <div :class="['todo-item', todo.completed ? 'completed':'']">
1 回答 !todo.completed
2 回答todo.completed
1 回答completed的值