How to use a Plugin in Vue.js 3
After a Vue app has been initialized with createApp()
, you can add a plugin to your application by calling the use()
method.
import { createApp } from 'vue'
import Root from './App.vue'
import i18nPlugin from './plugins/i18n'
const app = createApp(Root)
const i18nStrings = {
greetings: {
hi: 'Hallo!'
}
}
app.use(i18nPlugin, i18nStrings)
app.mount('#app')