Skip to content

Commit ad4f417

Browse files
committed
fix: update the fix of "finish" event of statistic countdown
1 parent 00853ae commit ad4f417

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: components/statistic/Countdown.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ export default {
5353
},
5454

5555
stopTimer() {
56+
const { value } = this.$props;
5657
if (this.countdownId) {
5758
clearInterval(this.countdownId);
5859
this.countdownId = undefined;
59-
this.$emit('finish');
60+
61+
const timestamp = getTime(value);
62+
if (timestamp < Date.now()) {
63+
this.$emit('finish');
64+
}
6065
}
6166
},
6267

0 commit comments

Comments
 (0)