When <el-form> missing `model`, validate will return false, then throw a warning to facilitate the developer troubleshooting

pull/6115/merge
leezng 2017-07-25 11:34:08 +08:00 committed by 杨奕
parent c1ce7a21b9
commit ce270fef4d
1 changed files with 4 additions and 0 deletions

View File

@ -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;
// fieldscallback