chore: fix vite modals

This commit is contained in:
WDaan 2022-11-15 11:37:28 +01:00
parent ab6ec174cb
commit 24a473e616
2 changed files with 11 additions and 13 deletions

View file

@ -12,7 +12,17 @@ import vuetify from './plugins/vuetify'
import i18n from './plugins/i18n'
import { toast, config } from './plugins/toast'
Vue.use(toast, config)
import './plugins/components'
// register modals
const components = import.meta.glob('./components/Modals/**/*.vue')
Object.entries(components).forEach(([path, definition]) => {
const componentName = path
.split('/')
.pop()
.replace(/\.\w+$/, '')
Vue.component(componentName, definition)
})
new Vue({
router,

View file

@ -1,12 +0,0 @@
import Vue from 'vue'
// register modals
const components = import.meta.glob('./components/Modals/**/*.vue')
Object.entries(components).forEach(([path, definition]) => {
const componentName = path
?.split('/')
?.pop()
?.replace(/\.\w+$/, '')
if (componentName) Vue.component(componentName, definition)
})