在调整大小事件中,将删除自定义css类,在mouseup上,将触发beforeWeekViewRender,并因此添加自定义css。这是在周视图中发生的。
我可以找到问题的根本原因。在日视图中效果很好。
在.html
中`
<mwl-calendar-week-view *ngSwitchCase="CalendarView.Week"
(beforeViewRender)="beforeWeekViewRender($event)"
[viewDate]="viewDate"
[events]="calendarEvents"
[refresh]="refresh"
(eventClicked)="handleEvent('Clicked',
$event.event)"
(eventTimesChanged)="eventTimesChanged($event)"
[hourSegmentTemplate]="weekViewHourSegmentTemplate"
>
</mwl-calendar-week-view>
`
In .ts
`
public eventTimesChanged({
event,
newStart,
newEnd
}: CalendarEventTimesChangedEvent): void {
let disabledArea = false;
if (!this.checkIfSegmentIsDisabled(newStart, 2)) {
event.start = newStart;
} else {
disabledArea = true;
}
if (!this.checkIfSegmentIsDisabled(newEnd, 2)) {
event.end = newEnd;
} else {
disabledArea = true;
}
if (!disabledArea)
this.handleEvent('Dropped or resized', event);
else alert("Excedio el limite");
this.refresh.next();
}
`
在调整大小事件期间,不应删除css