...
 
Commits (2)
    https://gitcode.net/f1dao/undraw-ui/-/commit/03063a1fc4dd5d73bd0953325b58ed860e62030b fix: 🐛 [counter]修复数字反向滚动(倒数)时的异常 2023-06-05T18:48:36+08:00 OceanH 1404939185@qq.com https://gitcode.net/f1dao/undraw-ui/-/commit/4fbbd103df5844199b5a278100914d7f6a48a4a8 Merge pull request #14 from Ocean-H1/fix-counter 2023-06-05T21:02:44+08:00 readpage 65387014+readpage@users.noreply.github.com fix: <gl-emoji title="bug" data-name="bug" data-unicode-version="6.0">🐛</gl-emoji> [counter]修复数字反向滚动(倒数)时的异常
......@@ -111,7 +111,7 @@ const counting = (timestamp: number) => {
let progress: number = timestamp - state.startTimestamp
state.remaining = state.currentDuration - progress
if (!isCountingUP) {
if (!isCountingUP()) {
state.currentAmount =
state.currentStartAmount - (state.currentStartAmount - props.endAmount) * (progress / state.currentDuration)
state.currentAmount = state.currentAmount < props.endAmount ? props.endAmount : state.currentAmount
......