mirror of https://github.com/ElemeFE/element
When <el-form> missing `model`, validate will return false, then throw a warning to facilitate the developer troubleshooting
parent
c1ce7a21b9
commit
ce270fef4d
|
@ -62,6 +62,10 @@
|
|||
});
|
||||
},
|
||||
validate(callback) {
|
||||
if (!this.model) {
|
||||
console.warn('[Element Warn][Form]model is required for validate to work!');
|
||||
return;
|
||||
};
|
||||
let valid = true;
|
||||
let count = 0;
|
||||
// 如果需要验证的fields为空,调用验证时立刻返回callback
|
||||
|
|
Loading…
Reference in New Issue