对CSS进行react-big-calendar导入失败 [英] react-big-calendar import failing for css
问题描述
我的React大日历工作正常,但CSS导入失败。
文档说:
I have the react big calendar working but the css import is failing. The documentation says:
样式可以在以下位置找到:react-big-calendar / lib / css / react-big-calendar.css,应该是
Styles can be found at: react-big-calendar/lib/css/react-big-calendar.css, and should be included on the page with the calendar component.
在其他示例中,我看到它是通过BigCalendar导入的,但它似乎不适用于我。
I've seen it imported w/ BigCalendar in other examples but it doesn't seem to be working for me.
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';
我该怎么做?
谢谢!
How do I do this? Thanks!
推荐答案
我找到了解决方案。只需将其添加到我的brunch-config.js文件即可。
I found the solution. Just needed to add this to my brunch-config.js file.
npm: {
styles: {
'react-big-calendar': ['lib/css/react-big-calendar.css']
}
},
如果您使用此解决方案,则可以删除导入。您不需要它。
If your using this solution you can delete the import. You don't need it.
这篇关于对CSS进行react-big-calendar导入失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!