【发布时间】:2018-12-11 10:35:53
【问题描述】:
我在https://api.myjson.com/bins/9jyq4 有一个 JSON
"response": [{
"id": "1",
"title": "Star Wars",
"project": [
"Star Wars Proj1",
"Star Wars Proj2",
"Star Wars Proj3",
"Star Wars Proj4"
]
},
{
"id": "2",
"title": "Back to the Future",
"project": [
"Back to the Future Proj1",
"Back to the Future Proj2",
"Back to the Future Proj3",
"Back to the Future Proj4"
]
},
..
..
我有两个选择器。 “标题”和“项目” 我正在使用填充标题选择器。
<Picker
mode="dialog"
selectedValue={this.state.Movietitle}
onValueChange={(itemValue, itemIndex) =>
this.setState({ Movietitle: itemValue });
}
enabled={!this.state.inRide}
>
{
this.state.responseData.map((item) => (
<Picker.Item label={item.title} value={item.id} key={item.id} />))
}
</Picker>
所以现在我想使用从第一个选择器中选择的选项填充第二个选择器“项目”。只需要帮助进行地图查询。谢谢
【问题讨论】:
-
特定 id 的数组,它们是什么?
-
你到底想要什么。给个样本吧。
-
更新了问题。请看
标签: javascript json reactjs react-native ecmascript-6