let fieldsToValidate = ['indicativePrice', 'name'];
      Promise.all(fieldsToValidate.map(item => {
        return new Promise((resolve, reject) => {
          this.$refs['formRef'].validateField(item, result => {
            resolve(result);
          })
        })
      })).then(result => {
        // result返回各个字段的验证信息,如果为空字符串则认为验证通过
        let msg = result.find(res => {
          return res != '';
        });
        
      })    

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-11-03
  • 2022-12-23
  • 2021-10-28
  • 2021-04-27
  • 2022-12-23
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-09-05
  • 2022-12-23
  • 2021-05-15
相关资源
相似解决方案