【发布时间】:2017-11-06 07:34:32
【问题描述】:
听到我调用显示页面查看功能组件加载
render() {
const { currentPageData } = this.props;
return (
<div>
{this.displayPageView()}
</div>
)
}
听 displaPageView 功能
displayPageView(){
const obj = {
centralead : {add: "1", edit: "1", index: "1", delete: "1"},
contacts : {add: "1", edit: "1", index: "1", view: "1", archive: "1"},
links : {add: "1", edit: "1", index: "1", view: "1", delete: "1"}
};
forEach(accessKey,(value,key) => {
console.log("key >>",key);
forEach(value,(value2,key2) => {
console.log("value2 >>",value2);
console.log("key2 >>",key2);
return (<div><h1>{key}</h1><h1>{key2}</h1><h1>{value2}</h1></div>);
});
});
}
我在 console.log 中获得了键和值,但机器人返回了该组件的视图。我使用了来自 'lodash' 的 foreach。
【问题讨论】: