Tencent / tdesign-vue

A Vue.js UI components lib for TDesign.
https://tdesign.tencent.com/vue
MIT License
887 stars 339 forks source link

[Form 表单] 动态字段校验不生效 #3203

Closed yanghuanrong closed 2 weeks ago

yanghuanrong commented 2 weeks ago

tdesign-vue 版本

1.9.4-naruto

重现链接

No response

重现步骤

当组件字段的 key 为动态的时候,执行validate校验,即使没有填写值,也总是校验为 true ,这是一个错误的行为

 <t-form :data="configData" ref="config" label-width="140px" >
   <t-form-item
      v-for="(item) in productConfig"
      :key="item.name"
      :label="item.cname"
      :name="'config.' + item.name"
      :help="'案例:'+ item.demo"
      :rules="[{ required: true, message: '此项必填' }]"
    >
      <t-input v-model="formData.config[item.name]"></t-input>
    </t-form-item>
  </t-form>

期望结果

期望表单字段动态的时候,可以与静态字段的表单校验效果一致

实际结果

No response

框架版本

Vue(2.7x)

浏览器版本

No response

系统版本

No response

Node版本

20.11.1

补充说明

No response

github-actions[bot] commented 2 weeks ago

👋 @yanghuanrong,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。