为什么Semantic-UI React Form.Dropdown无法正确处理状态数据?

时间:2019-08-19 08:44:00

标签: reactjs semantic-ui semantic-ui-react

我有这样的状态

volumeInfo: {
    authors: {
      authors: {
        allAuthorsFromDB: [
          {
            key: "5d553f721c9d440000c63433",
            text: "author",
            value: "author"
          },
          {
            key: "5d56b1eb1c9d4400000e897c",
            text: "author 2",
            value: "author 2"
          }
        ],
        defaultValue: ["author"],
        notFoundInDatabase: ["fghdfghgf"]
      }
    },
    showMessage: true
  }

还有一个下拉列表

<Form.Dropdown
  label={`Автор${volumeInfo.authors.length > 1 ? "ы" : ""}`}
  fluid
  multiple
  selection
  options={volumeInfo.authors.authors.allAuthorsFromDB}
  value={volumeInfo.authors.authors.defaultValue}
/>
<Message
  warning
  visible={volumeInfo.authors.showMessage}
  header="Could you check something!"
  list={[
    "That e-mail has been subscribed, but you have not yet clicked the verification link in your e-mail."
  ]}
/>

当尝试在页面上显示此内容时,直到我单击dropdown中的数据才会出现。

首次加载

--

在我单击它之后,他向我显示了数据。

--

0 个答案:

没有答案