【问题标题】:Using Fullcalendar methods inside React App在 React App 中使用 Fullcalendar 方法
【发布时间】:2019-11-30 00:24:08
【问题描述】:

Fullcalendar 事件可以被传入对象 props 的句柄拦截:

<FullCalendar
    eventDrop={ this.handleInternalDrop }                     
/>

如何使用getEvents()等Fullcalendar方法? https://fullcalendar.io/docs/Calendar-getEvents

【问题讨论】:

    标签: javascript reactjs fullcalendar fullcalendar-4


    【解决方案1】:

    这里是一个使用 getEvents() 方法的例子:

    export default class DemoApp extends React.Component {
    
      calendarRef = React.createRef()
    
      render() {
        return (
          <FullCalendar ref={this.calendarRef} />
        )
      }
    
      someMethod() {
        let calendarApi = this.calendarRef.current.getApi()
        calendarApi.getEvents()
      }
    
    }
    

    【讨论】:

      猜你喜欢
      • 2019-11-14
      • 1970-01-01
      • 2018-11-19
      • 2021-10-25
      • 2020-07-05
      • 2020-06-16
      • 2019-01-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多