vue+element-ui custom form validation multi-layer loop

vue+element-ui custom form validation multi-layer loop

Most of the forms in our project are user-defined forms

1. Set up a custom form (you can set the form display field, field type, and whether it is required)

insert image description here
2. Form display

Interface data format

insert image description here
the code

1. The parent layer is loop-bound under the current form, and then displays different components according to the element type.
2. The content of the prop must start from the root in the form of "array + index + ... + the name of the final verification value" (tried multiple The fixed format in the red box is still no problem) The verification is also judged according to the interface

insert image description here
page display

insert image description here

Guess you like

Origin blog.csdn.net/qq_44854653/article/details/127568682