+
{props.prefix || ctx.slots.prefix?.() ? (
{ctx.slots.prefix?.() || props.prefix}
) : null}
@@ -76,7 +74,9 @@ export default defineComponent({
{ctx.slots.suffix?.() || props.suffix}
) : null}
- {ctx.slots.extra?.() || props.extra}
+ {props.extra || ctx.slots.extra?.() ? (
+
+ ) : null}
)
}
diff --git a/packages/devui-vue/devui/statistic/src/utils/animation.ts b/packages/devui-vue/devui/statistic/src/utils/animation.ts
index 3b3eb192fa..9ab7230108 100644
--- a/packages/devui-vue/devui/statistic/src/utils/animation.ts
+++ b/packages/devui-vue/devui/statistic/src/utils/animation.ts
@@ -112,7 +112,6 @@ export class Tween {
const tick = () => {
this.update()
this.timer = requestAnimationFrame(tick)
-
if (this.finished) {
// 在判断 update中 结束后 停止 重绘
cancelAnimationFrame(this.timer)
diff --git a/packages/devui-vue/devui/statistic/src/utils/separator.ts b/packages/devui-vue/devui/statistic/src/utils/separator.ts
index 91178bccbc..17143eda8a 100644
--- a/packages/devui-vue/devui/statistic/src/utils/separator.ts
+++ b/packages/devui-vue/devui/statistic/src/utils/separator.ts
@@ -3,12 +3,11 @@ export type valueType = string | number
export const separator = (
SeparatorString: string, // value
groupSeparator: string, // 千分位分隔符
- showGroupSeparator: boolean // 是否展示千分位分隔符
): string => {
const res = SeparatorString.replace(/\d+/, function (n) {
// 先提取整数部分
return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) {
- return $1 + `${showGroupSeparator ? groupSeparator : ''}`
+ return $1 + `${groupSeparator}`
})
})
return res
@@ -23,8 +22,7 @@ export const analysisValueType = (
value: valueType, // 动态value 值
propsValue: valueType, // 用户传入value
groupSeparator: string, // 千位分隔符
- splitPrecisionNumber: number, // 分割精度, 小数点
- showGroupSeparator: boolean // 是否展示千分位分隔符
+ splitPrecisionNumber: number // 分割精度, 小数点
): string => {
const fixedNumber =
propsValue.toString().indexOf('.') !== -1
@@ -33,20 +31,12 @@ export const analysisValueType = (
if (typeof value === 'number') {
if (isHasDot(value)) {
return splitPrecisionNumber
- ? separator(
- value.toFixed(splitPrecisionNumber).toString(),
- groupSeparator,
- showGroupSeparator
- )
- : separator(value.toFixed(fixedNumber).toString(), groupSeparator, showGroupSeparator)
+ ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator)
+ : separator(value.toFixed(fixedNumber).toString(), groupSeparator)
} else {
return splitPrecisionNumber
- ? separator(
- value.toFixed(splitPrecisionNumber).toString(),
- groupSeparator,
- showGroupSeparator
- )
- : separator(value.toString(), groupSeparator, showGroupSeparator)
+ ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator)
+ : separator(value.toString(), groupSeparator)
}
} else {
return value
diff --git a/packages/devui-vue/docs/components/statistic/index.md b/packages/devui-vue/docs/components/statistic/index.md
index 4ae329547d..73f41d010e 100644
--- a/packages/devui-vue/docs/components/statistic/index.md
+++ b/packages/devui-vue/docs/components/statistic/index.md
@@ -15,13 +15,15 @@