Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker 声明 disabledDate 在 year 视图下性能差 #655

Open
dingziqi opened this issue Jul 10, 2023 · 0 comments
Open

DatePicker 声明 disabledDate 在 year 视图下性能差 #655

dingziqi opened this issue Jul 10, 2023 · 0 comments

Comments

@dingziqi
Copy link

dingziqi commented Jul 10, 2023

目前的 disabledDate 的设计是一个完全自由开放的设计,它可以是禁用连续的日期,可以是禁用独立的日期。

在渲染面板的时候,就会需要查找面板选项范围内是否存在可选的值,这样在极端情况下:即 year 面板,整年都不可选,则需要执行 365 次 disabledDate 才能推断出该年不可选。整个 year 面板最坏的情况是 3(列表) * 4 (行)* 365 次,相信没有人能接受这个性能吧😂。

所以我建议是不是在 year/month 视图不要应用 disabledDate,用户反正最终是要选到 date 上,能保证 date 的disabled 正常就可以了。或者是另外提供 disabledMonth、disabledYear 来解决性能问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant