react 遍历 object

  @observable obj = {
    name: "ajanuw",
    age: 22,
  };
  @computed get list() {
    return _.toPairs(this.obj);
  }

{list.map(([k, v]) => (<div>{k}:{v}</div>))}
posted @ 2018-12-26 11:07  Ajanuw  阅读(87)  评论(0编辑  收藏  举报