多个el-from提交表单时校验
1 /** 提交按钮 */ 2 async submitForm () { 3 let flg = true 4 await Promise.all([ 5 this.$refs['form'].validate(), 6 this.$refs['formTable'].validate(), 7 ]).catch((err) => { 8 flg = false 9 }) 10 if (!flg) { 11 this.$message.error('请检查必填信息是否填写完整') 12 return 13 } 14 }