🐛(component): [countUp]修复 useGrouping 属性异常

This commit is contained in:
sight 2022-08-30 13:47:07 +08:00
parent 82ff66d363
commit 2b36f7f8d0
2 changed files with 2 additions and 2 deletions

View File

@ -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");
}

View File

@ -7,7 +7,7 @@
::: demo
<template>
<h1 style="padding:20px 15px; font-family: sans-serif">
<h1 style="padding:20px 15px; font-family: sans-serif" >
<lay-count-up :startVal="0" :endVal="3600" :decimalPlaces="2"></lay-count-up>
</h1>
</template>