双表单校验

const p1=new Promise((resolve,reject)=>{
                _this.$refs['contract1'].rules = this.commitRules;
               _this.$refs['contract1'].validate(valid=>{
               if(valid) resolve()
              })
             })

 

             const p2=new Promise((resolve,reject)=>{
                 _this.$refs['contract2'].rules = this.commitRules;
            _this.$refs['contract2'].validate(valid=>{
              if(valid) resolve()
                 })
              }Promise.all([p1,p2]).then(()=>{
posted @ 2019-09-23 16:13  Mr、DIVE  阅读(195)  评论(0编辑  收藏  举报