如何使选择选项的值等于选择选项的å称

时间:2020-10-19 10:32:42

标签: reactjs axios html-select

enter image description here

```

为什么选择选项的IDä¸ç­‰äºŽé€‰æ‹©é€‰é¡¹çš„å称 为什么选择选项的IDä¸ç­‰äºŽé€‰æ‹©é€‰é¡¹çš„å称

componentDidMount() {
    axios
    .get("http://localhost:5000/Client")
    .then((response) => {
    this.setState({ client: [...response.data] });
    console.log(response.data);
  })
  .catch((err) => console.log(err));
 axios
   .get("http://localhost:5000/articles")
   .then((response) => {
    this.setState({ codeArticleList: [...response.data] });
    console.log(response.data);
    })
  .catch((err) => console.log(err));
  console.log(this.state.codeArticleList);
}
 handleChangeCdArt = (e) => {
this.setState({
  codeArtValue: e.target.value,
  });
  console.log(this.state.codeArtValue);
  };
**why id of select option not equal to select option name**

0 个答案:

没有答案