|
|
@@ -82,6 +82,11 @@ const isNumber = num => {
|
|
|
return typeof num == "number" && num.constructor == Number;
|
|
|
};
|
|
|
|
|
|
+//是否金额
|
|
|
+const isMoney = money =>{
|
|
|
+ return /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(money)
|
|
|
+}
|
|
|
+
|
|
|
// 是否为日期类型
|
|
|
const isDate = date => {
|
|
|
return typeof date == "object" && date.constructor == Date;
|
|
|
@@ -309,5 +314,6 @@ export default {
|
|
|
getCheckLogin,
|
|
|
numberFormat,
|
|
|
isString,
|
|
|
- unique
|
|
|
+ unique,
|
|
|
+ isMoney
|
|
|
};
|