Skip to content

Commit 4f48001

Browse files
committed
fix: 解决 CountDown 组件类型错误的问题
1 parent 4da7b73 commit 4f48001

File tree

1 file changed

+14
-3
lines changed
  • packages/taro-ui/src/components/countdown

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,19 @@ export default class AtCountdown extends React.Component<
128128
}
129129

130130
public render(): JSX.Element {
131-
const { className, customStyle, format, isShowDay, isCard, isShowHour } =
132-
this.props
131+
const {
132+
className,
133+
customStyle,
134+
format = {
135+
day: '天',
136+
hours: '时',
137+
minutes: '分',
138+
seconds: '秒'
139+
},
140+
isShowDay,
141+
isCard,
142+
isShowHour
143+
} = this.props
133144

134145
const { _day, _hours, _minutes, _seconds } = this.state
135146

@@ -145,7 +156,7 @@ export default class AtCountdown extends React.Component<
145156
style={customStyle}
146157
>
147158
{isShowDay && (
148-
<AtCountdownItem num={_day} separator={format.day || ''} />
159+
<AtCountdownItem num={_day} separator={format.day || ''} />
149160
)}
150161
{isShowHour && (
151162
<AtCountdownItem num={_hours} separator={format.hours} />

0 commit comments

Comments
 (0)