当鼠标经过 FullCalendar 中的元素时如何放置事件?

How to put an event when the mouse goes over an element in FullCalendar?

我有一个带有 FullCalendar(同名网站)的日历,我希望当我传递一个日期时它会变成另一种颜色

这是我的代码:

我试过他们的文档,但没有用

`<full-calendar defaultView="dayGridMonth" 
            (dateClick)="handleDateClick($event)" 
            locale="fr"
            [plugins]="calendarPlugins"
            [events]="events">
 </full-calendar>`

和 ts :

 `calendarPlugins = [dayGridPlugin, interactionPlugin];`

我想知道你有什么想法吗? 'eventMouseEnter', 'eventMouseLeave' 我试过了,但我不知道如何应用它

你可以这样做:

var calendar = new Calendar(calendarEl, {

  eventMouseEnter: function(info) {
    alert('Event: ' + info.event.title);
    alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
    alert('View: ' + info.view.type);

    // change the border color just for fun
    info.el.style.borderColor = 'red';
  }

});

请参阅此 link 了解更多信息:https://fullcalendar.io/docs/eventMouseLeave