首页 > 其他分享 >element 同时校验循环遍历的多个表单

element 同时校验循环遍历的多个表单

时间:2022-08-18 09:14:12浏览次数:59  
标签:count list 校验 表单 valid element

<div v-for="(arg, index) in list" :key="index">
 <el-form ref="`form-${index + 1}`" :model="arg"></el-form>
</div>
   let count = 0
   list.forEach((v, i) => {
    this.$refs[`form-${i+1}`].validate(valid => {
     if (valid) {
      count++
     }
    })
   })
   if (count === list.length) {
    alert('校验通过')
   }

 

标签:count,list,校验,表单,valid,element
From: https://www.cnblogs.com/150536FBB/p/16597509.html

相关文章