From 2b36f7f8d0761092397f9eab81563c437623e1c5 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Tue, 30 Aug 2022 13:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(component):=20[countUp]=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20useGrouping=20=E5=B1=9E=E6=80=A7=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/countUp/index.vue | 2 +- .../document-component/src/document/zh-CN/components/countup.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/component/src/component/countUp/index.vue b/package/component/src/component/countUp/index.vue index 43fd56f6..195c86e9 100644 --- a/package/component/src/component/countUp/index.vue +++ b/package/component/src/component/countUp/index.vue @@ -55,7 +55,7 @@ const formatNumber = (num: number | string): string => { let x1 = x[0]; const x2 = x.length > 1 ? props.decimal + x[1] : ""; const rgx = /(\d+)(\d{3})/; - if (props.separator && !isNumber(props.separator)) { + if (props.useGrouping && props.separator && !isNumber(props.separator)) { while (rgx.test(x1)) { x1 = x1.replace(rgx, "$1" + props.separator + "$2"); } diff --git a/package/document-component/src/document/zh-CN/components/countup.md b/package/document-component/src/document/zh-CN/components/countup.md index f189070a..8a7666c6 100644 --- a/package/document-component/src/document/zh-CN/components/countup.md +++ b/package/document-component/src/document/zh-CN/components/countup.md @@ -7,7 +7,7 @@ ::: demo