🐛(component): [countUp]修复 useGrouping 属性异常
This commit is contained in:
parent
82ff66d363
commit
2b36f7f8d0
@ -55,7 +55,7 @@ const formatNumber = (num: number | string): string => {
|
|||||||
let x1 = x[0];
|
let x1 = x[0];
|
||||||
const x2 = x.length > 1 ? props.decimal + x[1] : "";
|
const x2 = x.length > 1 ? props.decimal + x[1] : "";
|
||||||
const rgx = /(\d+)(\d{3})/;
|
const rgx = /(\d+)(\d{3})/;
|
||||||
if (props.separator && !isNumber(props.separator)) {
|
if (props.useGrouping && props.separator && !isNumber(props.separator)) {
|
||||||
while (rgx.test(x1)) {
|
while (rgx.test(x1)) {
|
||||||
x1 = x1.replace(rgx, "$1" + props.separator + "$2");
|
x1 = x1.replace(rgx, "$1" + props.separator + "$2");
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
::: demo
|
::: demo
|
||||||
|
|
||||||
<template>
|
<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>
|
<lay-count-up :startVal="0" :endVal="3600" :decimalPlaces="2"></lay-count-up>
|
||||||
</h1>
|
</h1>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user