react 遍历 object
@observable obj = {
name: "ajanuw",
age: 22,
};
@computed get list() {
return _.toPairs(this.obj);
}
{list.map(([k, v]) => (<div>{k}:{v}</div>))}
@observable obj = {
name: "ajanuw",
age: 22,
};
@computed get list() {
return _.toPairs(this.obj);
}
{list.map(([k, v]) => (<div>{k}:{v}</div>))}