Javascript 单击FullCalendar上的时隙时如何显示div?

Javascript 单击FullCalendar上的时隙时如何显示div?,javascript,reactjs,fullcalendar,fullcalendar-5,Javascript,Reactjs,Fullcalendar,Fullcalendar 5,当我在FullCalendar上选择一个时间段时,我试图显示一个div,但我不知道如何使用react。应该是这样的:。这是我的代码: > import React from 'react' import FullCalendar from > '@fullcalendar/react' import dayGridPlugin from > '@fullcalendar/daygrid' > > export default class DemoApp exten

当我在FullCalendar上选择一个时间段时,我试图显示一个div,但我不知道如何使用react。应该是这样的:。这是我的代码:

> import React from 'react' import FullCalendar from
> '@fullcalendar/react' import dayGridPlugin from
> '@fullcalendar/daygrid'
> 
> export default class DemoApp extends React.Component {
>     render() {
>         return (
>             <FullCalendar
>                 plugins={[dayGridPlugin]}
>                 events= 'https://fullcalendar.io/demo-events.json?overload-day&start=2020-11-01T00%3A00%3A00Z&end=2020-12-13T00%3A00%3A00Z&timeZone=UTC'
>                 selectable={true}
>                 select={(info)=>this.someMethod(info)}
>             />
>         )
>     }
>     someMethod() {
>     return "<div className='event-edit-popup'> <div className='flex'> <p>title</p></div></div>"   } }
>从“React”导入React从导入完整日历
>“@fullcalendar/react”从导入dayGridPlugin
>“@fullcalendar/daygrid”
> 
>导出默认类DemoApp扩展React.Component{
>render(){
>返回(
>插件={[dayGridPlugin]}
>事件https://fullcalendar.io/demo-events.json?overload-日期和开始日期=2020-11-01T00%3A00%3A00Z和结束日期=2020-12-13T00%3A00%3A00Z和时区=UTC'
>可选={true}
>选择={(信息)=>this.someMethod(信息)}
>             />
>         )
>     }
>someMethod(){
>返回“标题

”}”

我遗漏了什么???

我不是react专家,但也许这样做会有所帮助:(我只是在谷歌上搜索了“react如何显示div”-如果没有用,还有很多结果。到目前为止,你自己做了哪些研究?@ADyson非常感谢。我不需要穿上它。我需要把它写在日历上。例如,要在FullCalendar上编辑内容,我们有“eventContent”道具,我可以在其中显示/隐藏、编辑div。我一直在寻找类似eventContent的东西,当时没有任何事件。不过,一个eventContent等价物会将内容放入日历区域。不确定你是否真的想要这样-你会做什么改变?我认为你真正需要做的是显示一个模式弹出窗口,这样用户就可以根据他们刚刚在日历中选择的时间确认事件的细节。因此,您只需像已经做的那样处理“select”事件,然后让它显示模式弹出元素(通过react,或者如果您愿意,我想通过原生Javascript)。我有方法在将更改放入日历区域后保存更改,并更新日历。我想做一些类似谷歌日历的事情。为了添加一个新的事件,我想在所选日期旁边打开一个小弹出窗口,如附件中的图像。我已经有了一个工作模式。我明白了。如果您只打算使用dayGrid视图,那么我建议使用而不是
select
,因为该回调包含对网格中day区域的HTML元素的引用,因此您可以使用它相对于该元素定位popover。