Skip to content

Commit

Permalink
fix: statistic Countdown not update #3170
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Nov 14, 2020
1 parent 4456bbc commit b84b981
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions components/statistic/Number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 changes: 3 additions & 1 deletion components/statistic/Statistic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b84b981

Please sign in to comment.