Commit ce270fef authored by leezng's avatar leezng Committed by 杨奕

When <el-form> missing `model`, validate will return false, then throw a...

When <el-form> missing `model`, validate will return false, then throw a warning to facilitate the developer troubleshooting
parent c1ce7a21
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
}); });
}, },
validate(callback) { validate(callback) {
if (!this.model) {
console.warn('[Element Warn][Form]model is required for validate to work!');
return;
};
let valid = true; let valid = true;
let count = 0; let count = 0;
// 如果需要验证的fields为空,调用验证时立刻返回callback // 如果需要验证的fields为空,调用验证时立刻返回callback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment