BinarCode/vue-form-wizard

Form validation within child components.

mreduar opened this issue · 1 comments

Hi, I am here because I am having problems validating the forms inside the components of each step. Give an example to better understand what I want to achieve.
I have the following code.

<form-wizard>
    <tab-content>
        <step1></step1>
    </tab-content>
    <tab-content title="Público">
        <step2></step2>
    </tab-content>
    ...
</form-wizard>

I have several components, each containing everything from a single step.
For example in the step1 and step2 components, I have a form which I want to validate before passing to the next step.
How can I achieve this?
Due to the nature of the problem, I also don't know how to extract the form to the parent element. Which in this case is the component containing component.

In one example I realized that I can achieve this with before-change in conjunction with ref like this.
https://jsfiddle.net/CristiJ/bt5dhqtf/286/
Thank you