@fastcar/core 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -32,6 +32,11 @@ function getFormValue(value: any, prop: string, defaultValue?: any) {
|
|
|
32
32
|
return defaultValue;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
//默认值为空字符串的情况
|
|
36
|
+
if (typeof defaultValue == "string" && defaultValue == "") {
|
|
37
|
+
return defaultValue;
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
return null;
|
|
36
41
|
}
|
|
37
42
|
|
|
@@ -96,7 +101,7 @@ export default function ValidForm(target: any, methodName: string, descriptor: P
|
|
|
96
101
|
if (rule.required) {
|
|
97
102
|
throwErrMsg(rule, prop, rule.nullMessage);
|
|
98
103
|
} else {
|
|
99
|
-
if(TypeUtil.isObject(currObj) && !Reflect.has(currObj, prop)) {
|
|
104
|
+
if (TypeUtil.isObject(currObj) && !Reflect.has(currObj, prop)) {
|
|
100
105
|
delFormValue(currObj, prop);
|
|
101
106
|
}
|
|
102
107
|
}
|
|
@@ -31,6 +31,10 @@ function getFormValue(value, prop, defaultValue) {
|
|
|
31
31
|
if (ValidationUtil_1.default.isNotNull(defaultValue)) {
|
|
32
32
|
return defaultValue;
|
|
33
33
|
}
|
|
34
|
+
//默认值为空字符串的情况
|
|
35
|
+
if (typeof defaultValue == "string" && defaultValue == "") {
|
|
36
|
+
return defaultValue;
|
|
37
|
+
}
|
|
34
38
|
return null;
|
|
35
39
|
}
|
|
36
40
|
function setFormValue(obj, prop, val) {
|