这句代码看不懂,谁能解释一下
发布于 8 年前 作者 chenxiaohu 4547 次浏览 来自 问答

const { todos, actions } = this.props

这是Redux的todomvc示例中的代码

具体代码位置 请点击

3 回复
const todos = this.props.todos;
const actions = this.props.actions;

建议你先看看 ES6 入门.

谢谢!

明白了,代码的作用我能猜出来,就是不知道叫 “destructuring” :(

回到顶部