Loading

多个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     }

 

posted @ 2023-04-04 14:52  请叫我王小胖  阅读(25)  评论(0编辑  收藏  举报