{" top_menu":[{" id":1," name":" Menu 1"},{&#34 ; id":2," name":" Menu 2"}]," left_menu":[{" id":1 ,"名称":"菜单1"},{" id":2,"名称":"菜单2&#34 ;},{" id":3," name":" Menu 3"}]}
我有json数组,使用this.setState({ tabScreen: responseJson.top_menu });
渲染文本时,我无法访问 {this.state.tabScreen[1].name}
等数组元素。
答案 0 :(得分:0)
请尝试这样,
{this.state.tabScreen['top_menu'][1].name}