Answer the question
In order to leave comments, you need to log in
What is the best way to break one large form into several parts?
Hello colleagues!
I have one large form with several tabs on my project, and it would be logical to break each tab and separate it into its own component. But there are difficulties in how to do it.
What is:
There is a Data object - contains all the data to fill out the form.
There is a parent component where we forward this data
. In the MainForm.vue template, it is done like this:<main-form :data="data/>
<tabs>
<tab>
<part1-of-form :data="data"/>
</tab>
<tab>
<part2-of-form :data="data"/>
</tab>
</tabs>
<button @click='onSave'>Save</button>
Answer the question
In order to leave comments, you need to log in
You can write this.$root.$data in the child and change the corresponding parameters
I didn’t immediately figure out how to immediately regex the total length, and whether it will work, but it can be checked later.
regex101.com/r/wU7hV0/1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question