Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 如何使用语义用户界面反应下拉列表_Reactjs_Forms_Dropdown_Semantic Ui_Semantic Ui React - Fatal编程技术网

Reactjs 如何使用语义用户界面反应下拉列表

Reactjs 如何使用语义用户界面反应下拉列表,reactjs,forms,dropdown,semantic-ui,semantic-ui-react,Reactjs,Forms,Dropdown,Semantic Ui,Semantic Ui React,我正在尝试使用语义ui react和typescript来创建表单。所以我使用的是文档。然而,当我实现dropdow或表单时,我得到的是一个没有CSS的基本HTML表单。我应该怎么做才能获得与react.semantic-ui.com相同的用户体验 import { Dropdown } from 'semantic-ui-react' const options = [ { key: 1, text: 'Location 1', value: 1 }, { key: 2, text

我正在尝试使用语义ui react和typescript来创建表单。所以我使用的是文档。然而,当我实现dropdow或表单时,我得到的是一个没有CSS的基本HTML表单。我应该怎么做才能获得与react.semantic-ui.com相同的用户体验

import { Dropdown } from 'semantic-ui-react'
const options = [
   { key: 1, text: 'Location 1', value: 1 },
   { key: 2, text: 'Location 2', value: 2 },
   { key: 3, text: 'Location 3', value: 3 },
 ]

return (

    <Form>

       <div>
       <Dropdown
       placeholder='Etat *'
       title="Select Etat"
       fluid
       selection
       options={StatusOptions}
       />
       </div> 

</Form>
从“语义ui反应”导入{Dropdown}
常量选项=[
{键:1,文本:'Location 1',值:1},
{键:2,文本:'Location 2',值:2},
{键:3,文本:'Location 3',值:3},
]
返回(

您需要使用npm
npm i语义ui css安装默认主题

然后在
app.ts
index.ts

import'semantic ui css/semantic.min.css'

与Fayeed的上述回答类似。您可以在
index.html的头标签中导入CSS CDN

例如: