【发布时间】:2021-12-05 08:27:30
【问题描述】:
我有以下 Json
var initialdata = [
{
"type": "Feature",
"properties": {
"Region": "US",
"SubRegion": "US-1",
"SiteID": "234"
},
"geometry": {
"type": "Point"
}
},
{
"type": "Feature",
"properties": {
"Region": "US",
"SubRegion": "US-1",
"SiteID": "235"
},
"geometry": {
"type": "Point"
}
},
{
"type": "Feature",
"properties": {
"Region": "US",
"SubRegion": "US-2",
"SiteID": "234"
},
"geometry": {
"type": "Point"
}
},
{
"type": "Feature",
"properties": {
"Region": "UK",
"SubRegion": "UKK",
"SiteID": "121"
},
"geometry": {
"type": "Point"
}
},
{
"type": "Feature",
"properties": {
"Region": "UK",
"SubRegion": "UKK",
"SiteID": "121"
},
"geometry": {
"type": "Point"
}
}
]
我有基于 initialdata.properties 键的下拉菜单 例如,我有如下下拉菜单
Region
SubRegion
SiteID
如果用户选择 Region 下拉意味着,我需要以下输出作为用户选择列表,不重复
US
UK
我怎样才能做到这一点?
如果有人有任何想法,请与我分享
【问题讨论】:
标签: arrays reactjs json sorting filter