Browse Source

fix: statistic Countdown not update #3170

pull/3179/head
tangjinzhou 4 years ago
parent
commit
b84b981799
  1. 5
      components/statistic/Number.tsx
  2. 4
      components/statistic/Statistic.tsx

5
components/statistic/Number.tsx

@ -6,7 +6,7 @@ interface NumberProps extends FormatConfig {
value: valueType;
}
const Number: FunctionalComponent<NumberProps> = props => {
const StatisticNumber: FunctionalComponent<NumberProps> = props => {
const { value, formatter, precision, decimalSeparator, groupSeparator = '', prefixCls } = props;
let valueNode: VNodeTypes;
@ -50,4 +50,5 @@ const Number: FunctionalComponent<NumberProps> = props => {
return <span class={`${prefixCls}-content-value`}>{valueNode}</span>;
};
export default Number;
StatisticNumber.displayName = 'StatisticNumber';
export default StatisticNumber;

4
components/statistic/Statistic.tsx

@ -52,7 +52,9 @@ export default defineComponent({
value,
formatter,
};
let valueNode = <StatisticNumber {...props} />;
// data-for-update just for update component
// https://github.com/vueComponent/ant-design-vue/pull/3170
let valueNode = <StatisticNumber data-for-update={Date.now()} {...props} />;
if (valueRender) {
valueNode = valueRender(valueNode);
}

Loading…
Cancel
Save