V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
SystemLight

为什么前端的移动端 UI 组件库中的日期选择器都不能自由选择时间?

  •  
  •   SystemLight ·
    SystemLight · Oct 21, 2021 · 1975 views
    This topic created in 1656 days ago, the information mentioned may be changed or developed.
    • 如 vant 的选择器需要限定时间大小范围,nutUI 也如此
    • 而在 PC 端时间选择器都是可以自由选择任意时间的
    2 replies    2021-10-21 15:21:03 +08:00
    rioshikelong121
        1
    rioshikelong121  
       Oct 21, 2021
    没有范围的时间是危险的,传到后端 DB 里面可能会范围溢出。
    SQL Server 时间格式: https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql?view=sql-server-ver15
    yaojin
        2
    yaojin  
       Oct 21, 2021
    实现方式不一样, pc 是你点击下一个月的时候, 重新渲染新的数据, 可是移动端, 是需要将所有的数据先渲染的, 因为是滚动的一般是, 如果没有时间的限制, 会导致初始渲染的时候非常的卡, 你可以看看大多数移动端的日期的组件实现逻辑就知道了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   920 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 18:48 · PVG 02:48 · LAX 11:48 · JFK 14:48
    ♥ Do have faith in what you're doing.