diff --git a/resources/js/app.js b/resources/js/app.js index fef39c56..321fd174 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -5,16 +5,27 @@ import { createApp, h } from "vue"; import { createInertiaApp } from "@inertiajs/inertia-vue3"; import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers"; +// createInertiaApp({ +// title: (title) => `${title}`, +// resolve: (name) => +// resolvePageComponent( +// `./Pages/${name}.vue`, +// import.meta.glob("./Pages/**/*.vue") +// ), +// setup({ el, app, props, plugin }) { +// return createApp({ render: () => h(app, props) }) +// .use(plugin) +// .mount(el); +// }, +// }); createInertiaApp({ - title: (title) => `${title}`, - resolve: (name) => - resolvePageComponent( - `./Pages/${name}.vue`, - import.meta.glob("./Pages/**/*.vue") - ), - setup({ el, app, props, plugin }) { - return createApp({ render: () => h(app, props) }) - .use(plugin) - .mount(el); + resolve: name => { + const pages = import.meta.glob('./Pages/**/*.vue', { eager: false }) + return pages[`./Pages/${name}.vue`] }, -}); \ No newline at end of file + setup({ el, App, props, plugin }) { + createApp({ render: () => h(App, props) }) + .use(plugin) + .mount(el) + }, +}) \ No newline at end of file