Skip to content

Commit b84b981

Browse files
committed
fix: statistic Countdown not update #3170
1 parent 4456bbc commit b84b981

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/statistic/Number.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface NumberProps extends FormatConfig {
66
value: valueType;
77
}
88

9-
const Number: FunctionalComponent<NumberProps> = props => {
9+
const StatisticNumber: FunctionalComponent<NumberProps> = props => {
1010
const { value, formatter, precision, decimalSeparator, groupSeparator = '', prefixCls } = props;
1111
let valueNode: VNodeTypes;
1212

@@ -50,4 +50,5 @@ const Number: FunctionalComponent<NumberProps> = props => {
5050

5151
return <span class={`${prefixCls}-content-value`}>{valueNode}</span>;
5252
};
53-
export default Number;
53+
StatisticNumber.displayName = 'StatisticNumber';
54+
export default StatisticNumber;

components/statistic/Statistic.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export default defineComponent({
5252
value,
5353
formatter,
5454
};
55-
let valueNode = <StatisticNumber {...props} />;
55+
// data-for-update just for update component
56+
// https://github.com/vueComponent/ant-design-vue/pull/3170
57+
let valueNode = <StatisticNumber data-for-update={Date.now()} {...props} />;
5658
if (valueRender) {
5759
valueNode = valueRender(valueNode);
5860
}

0 commit comments

Comments
 (0)