是否可以向全日历免费事件添加文本?

时间:2019-04-26 10:22:04

标签: fullcalendar

如何在后台事件中显示text1text2等?

<pre>
{ 
  start: '2019-04-24', 
  end: '2019-04-28', 
  overlap: false, 
  rendering: 'background', 
  color: '#ff9f89' 
  text: 'text1' },
{ 
   start: '2019-04-06', 
   end: '2019-04-08', 
   overlap: false, 
   rendering: 'background', 
   color: '#ff9f89'  
   text: 'text2' 
}
</pre>

Expected result.

1 个答案:

答案 0 :(得分:0)

如果我很了解您的问题: 您应该使用事件的描述字段,然后可以在全日历回调中对其进行访问,例如在eventRender中:

 {id : 12, title : "titleEvent", start: 2019-05-05, description : "description for hover"}

         eventRender: function(info) {
          var tooltip = new Tooltip(info.el, {
                title: info.event.extendedProps.description,
                placement: 'top',
                trigger: 'hover',
                container: 'body'
              });
          },

将事件放置在日历中时会调用eventRender,因此每个事件都将触发此功能:工具提示来自tooltip.js和popper.js,当它们悬停在工具提示上时,它们将显示事件的描述