-
Notifications
You must be signed in to change notification settings - Fork 497
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
feat(statistic): new component #3329
Conversation
1.数据的 2.unit的字符用错token了,这里应该是 4.数值动画的后缀大小要用token, |
DONE |
}; | ||
|
||
const formatValue = computed(() => { | ||
let _value: number | undefined | string = innerValue.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
项目中禁止使用下划线开头的命名,辛苦后续调整下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #3643
|
||
onMounted(() => props.animation && props.animationStart && start()); | ||
|
||
expose({ start }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const trendIcons = { | ||
increase: <ArrowTriangleUpFilledIcon />, | ||
decrease: <ArrowTriangleDownFilledIcon />, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
常量 trendIcons
建议定义在组件最外面,而非 render
函数里,可避免每次渲染是计算时重复创建对象。一个数字可能没关系,但如果放在 Table 数据表中,就会变很多。
const trendIcons = {
increase: ArrowTriangleUpFilledIcon,
decrease: ArrowTriangleDownFilledIcon,
};
innerValue.value = to; | ||
}, | ||
}); | ||
(tween.value as any)?.start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里使用了 as any
,需要再次确认下具体是哪部分代码导致了 TS 类型丢失
🤔 这个 PR 的性质是?
🔗 相关 Issue
迁移vue2 statistic PR Tencent/tdesign-vue#2397
💡 需求背景和解决方案
📝 更新日志
feat(statistic): 新增
Statistic
统计数值组件本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单