Created
January 15, 2019 11:44
-
-
Save NarHakobyan/e827e7c9dee59df94fcd7d4642fba836 to your computer and use it in GitHub Desktop.
vee-validate in child components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parent Component: | |
... | |
provide () { | |
return { parentValidator: this.$validator } | |
}, | |
... | |
Child Component: | |
... | |
inject: [ 'parentValidator' ], | |
... | |
created () { | |
this.$validator = this.parentValidator | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then use fields and errors in your child component.