yunohost-admin/app/src/main.ts

48 lines
1 KiB
TypeScript
Raw Normal View History

import { createApp } from 'vue'
2020-07-06 19:08:34 +02:00
import App from './App.vue'
import { createBootstrap } from 'bootstrap-vue-next'
2024-03-04 15:12:40 +01:00
import { VueShowdownPlugin } from 'vue-showdown'
2020-08-29 19:05:56 +02:00
import store from './store'
import router from './router'
import i18n from './i18n'
import { registerGlobalErrorHandlers } from './api'
import { initDefaultLocales } from './i18n/helpers'
import '@/scss/main.scss'
const app = createApp({
...App,
})
app.use(store)
app.use(router)
app.use(i18n)
app.use(createBootstrap())
2020-08-29 19:05:56 +02:00
2024-03-04 15:12:40 +01:00
app.use(VueShowdownPlugin, {
flavor: 'github',
2021-08-14 14:37:19 +02:00
options: {
2024-02-24 18:25:12 +01:00
emoji: true,
},
2021-08-14 14:37:19 +02:00
})
// Register global components
2024-02-24 18:25:12 +01:00
const globalComponentsModules = import.meta.glob(
['@/components/globals/*.vue', '@/components/globals/*/*.vue'],
{ eager: true },
)
Object.values(globalComponentsModules).forEach((module) => {
const component = module.default
app.component(component.name, component)
})
registerGlobalErrorHandlers()
// Load default locales translations files and setup store data
initDefaultLocales().then(() => {
app.mount('#app')
})