Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A strategy to validate child components with Vue and Vee Validate.
// Somewhere in the initialization:
import VeeValidate from "vee-validate";
// Then, in the parent component:
export default {
provide () {
return { parentValidator: this.$validator }
// Then, in the child component:
export default { // or `export default Vue.extend({`
inject: ["parentValidator"],
created() {
this.$validator = this.parentValidator
// Then, in the component to be validated (example):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment