解决计量单位页面校验错误的bug

This commit is contained in:
季圣华
2023-03-17 19:08:41 +08:00
parent e37b2e440d
commit 6153c49765
2 changed files with 3 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ export function isURL (s) {
* @param {*} s
*/
export function isDecimalTwo (s) {
let reg = /^(([^0][0-9]+|0)\.([0-9]{1,2})$)|^([^0][0-9]+|0)$/
let reg = /^[0-9]+(\.[0-9]{1,2})?$/
return reg.test(s)
}
@@ -44,7 +44,7 @@ export function isDecimalTwo (s) {
* @param {*} s
*/
export function isDecimalThree (s) {
let reg = /^(([^0][0-9]+|0)\.([0-9]{1,3})$)|^([^0][0-9]+|0)$/
let reg = /^[0-9]+(\.[0-9]{1,3})?$/
return reg.test(s)
}