我让react大日历正常工作,但css导入失败。文档中写道:
样式可以在: react-big-calendar/lib/css/react-big-calendar.css,中找到,并且应该包含在日历组件的页面中。
我在其他示例中看到它导入了w/ BigCalendar,但它似乎对我不起作用。
import '/react-big-calendar/lib/css/react-big-calendar.css';
import BigCalendar from 'react-big-calendar';
import moment from 'moment';
import Month from './Month';
import React from 'react';
import Showfeed from './Showfeed';
我该怎么做呢?谢谢!
发布于 2016-11-29 13:58:13
我找到了解决方案。我只需要将它添加到我的早午餐-config.js文件中。
npm: {
styles: {
'react-big-calendar': ['lib/css/react-big-calendar.css']
}
},
如果您使用此解决方案,则可以删除导入。你不需要它。
发布于 2018-07-24 10:56:51
尝试将此CDN添加到您的-react-project-root/public/index.html中
<link href="https://cdn.jsdelivr.net/npm/react-big-calendar@0.19.0/lib/css/react-big-calendar.css" rel="stylesheet"/>
这对我很有效
发布于 2018-06-21 09:01:28
这对我很管用
import '!style-loader!css-loader!react-big-calendar/lib/css/react-big-calendar.css';
https://stackoverflow.com/questions/40837152
复制相似问题