Basic tenant structure

This commit is contained in:
2026-01-31 20:07:41 +01:00
parent 825af15962
commit 3570f442f5
35 changed files with 634 additions and 144 deletions

View File

@@ -5,43 +5,32 @@ import { InertiaProgress } from '@inertiajs/progress'
import Vue3Toastify, { toast } from 'vue3-toastify'
import 'vue3-toastify/dist/index.css'
// Optional: Lade-Balken für Inertia
InertiaProgress.init()
// Inertia App starten
createInertiaApp({
// Alle Pages in app/Views/Pages/**/*.vue werden automatisch importiert
resolve: name => {
// Vite scannt die Pages dynamisch
const pages = import.meta.glob('@views/**/*.vue')
const pages = import.meta.glob('@domains/**/*.vue')
// Suche nach der richtigen Page-Datei
const key = Object.keys(pages).find(k =>
k.endsWith(`/${name}.vue`) || k.endsWith(`/${name}/index.vue`)
)
if (!key) throw new Error(`Page not found: ${name}`)
// Unterstützt sowohl <script setup> als auch klassische Exports
return pages[key]()
},
// Setup der App
setup({ el, App, props, plugin }) {
const vueApp = createApp({ render: () => h(App, props) })
// Inertia Plugin
vueApp.use(plugin)
// Toastify global verfügbar machen
vueApp.use(Vue3Toastify, {
autoClose: 3000,
position: 'top-right',
pauseOnHover: true,
})
vueApp.config.globalProperties.$toast = toast
// Mounten auf das DOM
vueApp.config.globalProperties.$toast = toast
vueApp.mount(el)
},
})