【发布时间】:2018-09-30 01:28:32
【问题描述】:
我想我按照其他人所说的设置“semantic-ui-react”的所有步骤进行操作,但出现错误。
错误 ./assets/components/UserPage/UserPageQuestion/UserPageQuestion.js 未找到模块:错误:无法解析 'semantic-ui-react' in 'C:\Users\1Sun\Cebula3\cebula_react\assets\components\UserPage\UserPageQuestion' @ ./assets/components/UserPage/UserPageQuestion/UserPageQuestion.js 31:0-67 91:63-70 91:98-104 93:29-35 93:76-81 95:31-38 95:66-72 98:29-35 100:42-47 @ ./assets/components/UserPage/index.js @ ./assets/components/UserPage/UserPage.js @multi ./assets/components/UserPage/UserPage.js
package.json
...
"dependencies": {
...
"semantic-ui-css": "^2.3.3",
"semantic-ui-react": "^0.82.4",
...
}
...
UserPageQuestion.js
import { Dimmer, Loader, Image, Segment } from 'semantic-ui-react'
import '../../../../../static/cebula/Semantic-UI-CSS-master/semantic.min.js';
import '../../../../../static/cebula/Semantic-UI-CSS-master/semantic.min.css';
const UserPageQuestion = () => {
return (
<Segment>
<Dimmer active>
<Loader>Loading</Loader>
</Dimmer>
<Image src='/images/wireframe/short-paragraph.png' />
</Segment>
)
}
有什么问题??
【问题讨论】:
-
为什么要导入 semantic.min.* ?
标签: javascript reactjs semantic-ui semantic-ui-react