Sign in

How to verify multiple different types of input boxes by adding or deleting form items dynamically in element UI

zvej edited in Sat, 03 Dec 2022

Similar to this kind of addition, two input boxes are added at a time. But I don't know how to write it. I don't know if a big man has ever met such a scene. Or there is a better solution, please provide.

2 Replies
commented on Sat, 03 Dec 2022

Refer to this: https://blog.csdn.net/qq_ 4020...

commented on Sat, 03 Dec 2022

You can put validation rules in El form item. Similar to: elementui form dynamically increases or decreases form items

    v-for="(domain, index) in dynamicValidateForm.domains"
    :label="'域名' + index" 
    :prop="'domains.' + index + '.value'"
    :rules="{ required: true, message: '域名不能为空', trigger: 'blur' }"

You can also click DEMO on the lower right corner of the online operation to debug in CodePen.