0👍
update your code like so:
MyComponent.vue:
Use Vue’s async component loading for the components.
<template>
<div>
<validated-input/> <!-- injected from plugin.js -->
<autocomplete-input/>
</div>
</template>
<script>
export default {
// ...
};
</script>
plugin.js:
Remove the component registrations from the install function.
import VeeValidate from 'vee-validate';
export default {
install(Vue, options) {
Vue.use(VeeValidate, {
inject: ['$validator'],
fieldsBagName: 'veeFields',
});
},
};
page.vue:
Use async component loading for MyComponent.
<template>
<MyComponent/>
</template>
<script>
export default {
components: {
MyComponent: () => import('../MyComponent'),
},
};
</script>
Source:stackexchange.com