Browse Source

fix(form-item): add attr empty status warn

richard1015 4 years ago
parent
commit
1da8fc1a78
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/packages/__VUE/form/common.ts

+ 5 - 1
src/packages/__VUE/form/common.ts

@@ -72,7 +72,11 @@ export const component = {
         return keyPath.split('.').reduce((prev, curr) => prev[curr], obj);
       };
 
-      let value = getPropByPath(props.modelValue, prop);
+      if (!prop) {
+        console.warn('[NutUI] <FormItem> 使用 rules 校验规则时 , 必须设置 prop 参数');
+      }
+
+      let value = getPropByPath(props.modelValue, prop || '');
 
       // clear tips
       tipMessage({ prop, message: '' });