app.ts 497 Bytes
import {createApp, h} from 'vue'
import {createInertiaApp} from '@inertiajs/vue3'
import {resolvePageComponent} from "laravel-vite-plugin/inertia-helpers";

createInertiaApp({
    resolve: (name) => resolvePageComponent(`./page/${name}/index.vue`, import.meta.glob('./page/**/*.vue') as any),
    setup({el, App, props, plugin}) {
        createApp({render: () => h(App, props)}).use(plugin).mount(el)
    },
}).finally(() => {
    document.getElementById('app')?.removeAttribute('data-page')
})