ios - iPhone上的Fullcalendar(角度)糟糕的性能
问题描述
我已经在 Angular 中使用了 fullcalendar 包来显示一个月的事件。日期和事件都可以点击,并且有处理日期点击和事件点击的功能。它在台式机和安卓手机上运行良好,但问题出在 iPhone 上,每次点击日期/事件都会有明显的延迟。点击一个事件后,需要一些时间来呈现选择。
我注意到每次点击事件时都会调用 eventContent 并且多次调用它,有时会收到以下警告,
[Violation] 'setInterval' handler took 52ms
[Violation] 'setTimeout' handler took 66ms
[Violation] Forced reflow while executing JavaScript took 31ms
我已经尝试过评论选择处理和 eventContent 函数,但没有发现任何显着差异。
全日历初始化
this.calendarOptions = {
headerToolbar: {
left: '',
right : 'prev title next'
},
customButtons:
{
prev:{
click:this.previousMonth.bind(this)
},
next:{
click:this.nextMonth.bind(this)
},
},
showNonCurrentDates: false,
fixedWeekCount: false,
views: {
dayGridMonth: { // name of view
titleFormat: {month:"2-digit"}
}
},
dayCellContent: arg => {
return arg.date.getDate();
},
aspectRatio:1.2,
height: 'auto',
unselectAuto: false,
eventColor:"white",
locale:jaLocale,
rerenderDelay:1,
initialDate: 2021-09-17,
events:this.Price,
eventContent:this.renderEvent,
select: this.handleDateSelect.bind(this),
dateClick: clickInfo => {
const calendarApi = clickInfo.view.calendar;
calendarApi.select(clickInfo.date);
},
eventClick: clickInfo => {
const calendarApi = clickInfo.view.calendar;
calendarApi.select(clickInfo.event.start);
},
datesSet: this.handleDatesSet.bind(this),
unselect: this.handleDateUnselect.bind(this)
};
解决方案
推荐阅读
- hadoop - 将数据从 .csv 文件加载到配置单元表
- php - 如何/可以根据不断的请求定义一个常量?
- javascript - JS SQL 输出字符串或对象
- python - Python(递归):递归中的“TypeError:字符串索引必须是整数”
- javafx - 如何在 TableView 中获取具有(列 x 和行 y)的特定单元格?javafx
- vue.js - Nuxt 生成显示错误:无法读取未定义的属性“normalModuleFactory”
- php - 去掉()前后的''
- express - Mongoose 的异步等待返回空对象
- php - PHP - 用预定义的键列表替换数组键
- sas - SAS中的格兰杰因果关系