简体   繁体   English

初始化2个datepickers非常慢

[英]Initialization of 2 datepickers very slow

I'm using the datepicker of Angular-UI . 我正在使用Angular-UI的日期选择器。

I have a template that initializes 2 datepickers. 我有一个初始化2个datepickers的模板。

However, I noticed that it takes more than 100 ms on a desktop to initialize both. 但是,我注意到桌面上需要超过100毫秒来初始化它们。
It is worse than that using a two-years old mobile device. 它比使用两年的移动设备更糟糕。
I have the following declaration (2 times so): 我有以下声明(2次):

<input type="text" ng-model="schedule.start" datepicker-popup date-disabled="disabled(date, mode)"/>

However, when I remove the datepickerPopup directive, it takes less than 100ms. 但是,当我删除datepickerPopup指令时,它需要不到100毫秒。

Is there a way a trick to increase performance of datepickerPopup directive? 有没有办法提高datepickerPopup指令的性能?

There is a pull request here that wraps the date picker popup in an ng-if that should fix that. 这里有一个pull请求它将日期选择器弹出窗口包含在ng中 - 如果应该修复它。 The performance hit comes from the DOM rendering all the calendar elements. 性能打击来自DOM呈现所有日历元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM