antd vue table表格内添加表单验证方法

业务需求;需要table内的某项或者某些项能编辑;并且需要校验规则

antd vue table表格内添加表单验证方法_第1张图片

1.在form-model放置在 table 内



    
      
        
      
    
  


for (const key in _this.$refs) {
  if (key === 'con') break
  _this.$refs[key].validate(async valid => {
    if (!valid) return false
  })
}

2.将table放置在form-model 内



  
    
  



_this.$refs.formData.validate(async valid => {
          if (!valid) return
})

重点是 :prop="siteList.${index}.endTime"

你可能感兴趣的:(antd vue table表格内添加表单验证方法)