Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

javascript - 在React中使用Fullcalendar v4导入rrule插件(import rrule plugin with fullcalendar v4 in React)

I'm having problems with getting fullcalendar version 4 to show recurring events in a React app.(我在获取全日历版本4以在React应用程序中显示重复事件时遇到问题。)

I used this tutorial(我使用了本教程)

the statement import 'fullcalendar/plugins/rrule';(语句import 'fullcalendar/plugins/rrule';)

gives me the error:(给我错误:)
Module not found: Can't resolve 'fullcalendar/plugins/rrule'

So I changed the import statement to 'fullcalendar/dist/plugins/rrule';(所以我将import语句更改为'fullcalendar/dist/plugins/rrule';)

Now I get errors from rollup which I solved by adding external: [ 'rrule' ] in rollup.config.js(现在我从汇总中得到了错误,可以通过在rollup.config.js添加external: [ 'rrule' ]rollup.config.js)

All I want to do is show some recurring events in fullcalendar version 4 (so no JQuery dependency) and React.(我要做的就是在fullcalendar版本4(因此没有JQuery依赖项)和React中显示一些重复发生的事件。)

Any help would be appreciated(任何帮助,将不胜感激)

I started a project on code sandbox but couldn't get fullcalendar v4 to load.(我在代码沙箱上启动了一个项目,但无法加载fullcalendar v4。)

编辑n0lvqzmw9m

  ask by Dany Dhondt translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Ok, this question is a little old, but i've had faced similar problem and this is how i solved it.(好的,这个问题有点老了,但是我遇到过类似的问题,这就是我解决的方法。)

First, in your CodeSandbox you're import without the @(首先,在您的CodeSandbox中,您无需使用@)

import { Calendar } from '@fullcalendar/core'

Second in your dependencies you haven't installed rrule, just the plugin, you can install by running:(其次,在依赖项中,您尚未安装rrule,仅安装了插件,可以通过运行以下命令进行安装:)

yarn add rrule

or(要么)

npm install rrule

you can find full documentation here: https://github.com/jakubroztocil/rrule(您可以在这里找到完整的文档: https : //github.com/jakubroztocil/rrule)

Hope it helps.(希望能帮助到你。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...