Explorar o código

检查正整数

skyblued %!s(int64=2) %!d(string=hai) anos
pai
achega
056f127d3f
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      src/helpers/toolsValidate.ts

+ 10 - 0
src/helpers/toolsValidate.ts

@@ -75,6 +75,16 @@ export function verifiyNumberInteger(val: string) {
 }
 
 /**
+ * 检测正整数
+ * @param val 当前值字符串
+ * @returns 返回boolean
+ */
+export function checkNumberInteger(val: string) {
+  var rep = /[\.]/
+  return !!rep.test(val)
+}
+
+/**
  * 去掉中文及空格
  * @param val 当前值字符串
  * @returns 返回处理后的字符串