【问题标题】:Why React Big Calendar does not display events?为什么 React Big Calendar 不显示事件?
【发布时间】:2017-12-20 19:45:37
【问题描述】:

我按照文档上传了一个项目here

没有错误,但不显示事件。这是一些代码:

<BigCalendar
  events={events}
  startAccessor='startDate'
  endAccessor='endDate'
  defaultDate={new Date(2017, 11, 1)}
  views={allViews}
  defaultView='day'
  titleAccessor='tttttttt'
  components={{
    event: Event,
    agenda: {
      event: EventAgenda
    }
  }}
/>

无法理解问题所在。根据这个answer我添加了一些样式,但结果是一样的。 包含 React Big Calendar 文档的页面是 here

【问题讨论】:

    标签: reactjs react-big-calendar


    【解决方案1】:

    确保您的活动日期与访问者匹配。

    当您定义“startAccessor”和“endAccessor”时,它将查看事件日期的那些。在事件的示例数据中,大日历提供日期的“结束”和“开始”。

    开始/结束访问器的默认状态是“开始”和“结束”,因此如果您更改为“开始日期”和“结束日期”,您的事件日期需要与之匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-22
      • 2021-10-03
      • 1970-01-01
      • 2021-02-16
      • 1970-01-01
      • 2018-06-24
      • 2017-07-14
      • 2018-01-16
      相关资源
      最近更新 更多