1

I am using antd and vue3 in my project. Hence I validating the fields with antd validation.

The validation is not working properly. I have provided only the required validation. It is denoting If I din't enter the value. But The error message is not disappearing even after entering the proper value.

In my usecase, Since I am creating the fields dynamically. I am looping the fields using v-for. Refer the below code for further clarification,

<a-row :gutter="16">
    <a-col class="gutter-row" :span="12" v-for="(field, index) in Object.entries(formState.additonal_data)">
        <a-form-item :label="field[0].replaceAll('_', ' ')" :name="`additonal_data[${field[0]}]`" :rules="[{ required: true, message: 'Please input your '+field[0].replaceAll('_', ' ') }]">
            <a-input v-model:value="formState.additonal_data[field[0]]" />
        </a-form-item>
    </a-col>
</a-row>

In the below image, You can see even after entering details, The error message is not disappearing. I need it to be disappeared once If the proper values are entered.

enter image description here

Any help is appreciated.

Thanks in advance.

Sujith Sandeep
  • 1,185
  • 6
  • 20

0 Answers0