Skip to content

Commit d65bebb

Browse files
authored
Merge pull request #1665 from luckymore/fix-countdown-timer
fix: 修复无法动态更改倒计时问题
2 parents d162f17 + 60a9f5b commit d65bebb

File tree

1 file changed

+4
-8
lines changed
  • packages/taro-ui/src/components/countdown

1 file changed

+4
-8
lines changed

packages/taro-ui/src/components/countdown/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default class AtCountdown extends React.Component<
5555
private clearTimer(): void {
5656
if (this.timer) {
5757
clearTimeout(this.timer as number)
58+
this.timer = 0
5859
}
5960
}
6061

@@ -127,14 +128,9 @@ export default class AtCountdown extends React.Component<
127128
}
128129

129130
public render(): JSX.Element {
130-
const {
131-
className,
132-
customStyle,
133-
format,
134-
isShowDay,
135-
isCard,
136-
isShowHour
137-
} = this.props
131+
const { className, customStyle, format, isShowDay, isCard, isShowHour } =
132+
this.props
133+
138134
const { _day, _hours, _minutes, _seconds } = this.state
139135

140136
return (

0 commit comments

Comments
 (0)