Skip to content

希望useCountdown增加一个参数 #1727

@frontlich

Description

@frontlich

useCountdown现在存在两个问题

  1. 内部计算剩余时间的 calcLeft 函数,采用的是 new Date().getTime(),不是服务器时间,可能会产生倒计时不准的问题
  2. 如果想做验证码或者确认按钮的倒计时,还得计算出targetDate,不方便

希望增加一个参数 leftTime,即剩余时间毫秒数,这样可以解决以上两个问题

  1. 通过 targetDate - timeStamp(服务器返回的时间戳) 计算出剩余时间可解决
  2. 如果想倒计时60s,直接传leftTime: 60 * 1000 即可

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions