I just read the persistent layout part here? https://inertiajs.com/pages
I use react but vue should be a matter of following the guide as well
Has anyone figured out how to correctly set the app.js file to handle persistent layouts?
I managed to solve this setting the createInertiaApp function like this:
createInertiaApp({
title: (title) => `${title} - ${appName}`,
resolve: (name) => {
const page = resolvePageComponent(
`./Pages/${name}.vue`,
import.meta.glob("./Pages/**/*.vue")
);
page.then((module) => {
module.default.layout = module.default.layout || AppLayout;
});
return page;
},
setup({ el, app, props, plugin }) {
return createApp({ render: () => h(app, props) })
.use(plugin)
.use(ZiggyVue, Ziggy)
.mount(el);
},
});
I'm definitely not sure this is the right way so if someone knows of a better way please feel free to share :)
Please or to participate in this conversation.