Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statistic.Countdown 动画无显示 #3170

Closed
wants to merge 9 commits into from
Closed

Conversation

chsword
Copy link
Contributor

@chsword chsword commented Nov 13, 2020

这个变动的性质是

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 组件样式改进
  • TypeScript 定义更新
  • 重构
  • 代码风格优化
  • 分支合并
  • 其他改动(是关于什么的改动?)

需求背景

https://2x.antdv.com/components/statistic-cn/ 中 Countdown 的功能无法正常运行

实现方案和 API(非新功能可选)

  1. 首先 functional component 的 Number 应该是不支持状态维护的,没有刷新机制,所以需要改为 defineComponent
  2. 另外 需要在 Statistic 中的 update 中强制刷新 StatisticNumber
  updated(){
    (this.$refs.statisticNumber as any).$forceUpdate();
  },

  let valueNode = <StatisticNumber ref="statisticNumber" {...props} />;
  1. Number 这个名称,与关键字重名,建议改为 StatisticNumber

对用户的影响和可能的风险(非新功能可选)

  1. 可能的性能问题

tangjinzhou added a commit that referenced this pull request Nov 14, 2020
@tangjinzhou
Copy link
Member

感谢贡献,这种方式的改动会更好一些
b84b981

@chsword chsword deleted the next branch November 23, 2020 07:56
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants