1

我是新来的反应本地人。我正在尝试创建动态下拉选择器。我想在其中显示来自 API 数据的价值。所以请帮忙。这是我的代码

{this.state.datax.map( (item ,i) =>
  <DropDownPicker key = {i} style={styles.inputStyle} 
              items={[
                  {label: (item.id), value: (item.id)},
              ]}
              defaultValue={this.state.nature}
              containerStyle={{    height: Dimensions.get('window').height / 20.5}}
              itemStyle={{
                  justifyContent: 'flex-start',
              }}
              dropDownStyle={styles.inputStyleD}
              onChangeItem={item => this.setState({
                  nature: item.value
              })}
          />)}

我的 API 数据看起来像这样

[{"message":"success","data":{"proof_of_identity":[{"id":"8","document_name":"Driving License With Authorized
Signatories "},{"id":"7","document_name":"Defense ID "},{"id":"6","document_name":"Voter ID
Card"},{"id":"5","document_name":"Passport"}],"proof_of_business":[{"id":"15","document_name":"Tax
Invoice"},{"id":"14","document_name":"Memorandum and Articles of Association"},{"id":"13","document_name":"Society Bye
Laws "},{"id":"12","document_name":"Trust Deed "},{"id":"11","document_name":"Partnership
Deed"}],"proof_of_address":[{"id":"10","document_name":"Certificate of Incorporation
"},{"id":"9","document_name":"Registration Document "},{"id":"3","document_name":"Test Business Copy"}]}}]

那么如何显示身份证明和业务证明的所有文件名称以及所有

4

0 回答 0