更改 FullCalendar 中事件的宽度(React JS)
我喜欢在 React JS 上下文中更改事件的宽度。
此处描述的类似问题:
不幸的是,在引用的问题中什么也没有提到了如何在react环境中解决这个问题。
I like to change the width of an event in context of React JS
.
Similiar questions described here:
Unfortunately, in the quoted questions is nothing mentioned how to solve this in a react environment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想出了如何去做。
eventRender
不再存在 (v4),而是不同的“事件渲染挂钩”(v5):eventClassNames
:专门用于更改事件eventContent< 的 .css /code>:将内容注入到事件
现在,根据您想要实现的目标,在 React JS 中有两种方法可以实现此目的。 (注意:我使用了
TypeScript
)将 CSS 更改应用于所有事件
我们可以使用
styled
为任何事件创建我们自己的 .css 定义并使用作为包装器 (StyleWrapper
)将特定 CSS 应用于特定事件
通过这种方式,您可以准确地告诉
FullCalendar
事件的外观取决于您添加到的自定义道具 事件。您自定义的 props 将被添加到extendedProps
中,它将在我们的事件渲染钩子eventClassNames
中使用I figured it out how to do it.
eventRender
does no longer exist (v4) but instead different "event render hooks" (v5):eventClassNames
: Specifically for changing the .css of an eventeventContent
: To inject content into the eventNow, depending what you want to achieve, there are two ways to do this in React JS. (Note: I used
TypeScript
)Applying CSS change to all events
We can use
styled
to create our own .css definition for any event and use that as a wrapper (StyleWrapper
)Apply specific CSS to specific events
With this way, you can tell
FullCalendar
exactly how an event has to look like depending self-defined props you add to an event. Your self-defined props will be added toextendedProps
which will be used in our event render hookeventClassNames