我正在尝试使用semantic-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>发布于 2020-03-21 02:48:17
您需要使用npm npm i semantic-ui-css安装默认主题
然后在您的app.ts或index.ts中导入该主题
import 'semantic-ui-css/semantic.min.css'发布于 2020-03-21 03:52:47
类似于上面Fayeed的回答。您可以在index.html的header标签中导入CSS CDN
例如:
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" />
https://stackoverflow.com/questions/60779859
复制相似问题