[Vuejs]-How to import vForm globally in index.js using Vue js 3

0👍

Well, it works the same in Vue 3 – but instead of using the global Vue you use your app:

import { createApp } from 'vue';
import App from './App.vue';
import router from './router'; 
import { Form, HasError, AlertError } from 'vform';

const myApp = createApp(App);
myApp.use(router);
myApp.component('v-form', Form);
myApp.component('has-error', HasError);
myApp.component('alert-error', AlertError);
myApp.mount('#app'); 

Leave a comment