Inertia multi rootView config #4580
-
I'm testing Adonis with Inertia adapter, I see that we can define the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, we don't have anything for that today. Having to add middleware for that seems a bit cumbersome to me What about allowing a function for import { defineConfig } from '@adonisjs/inertia';
export default defineConfig({
rootView: ({ request }: HttpContext) => {
if (request.url().startsWith('/admin')) {
return 'admin_layout';
}
return 'inertia_layout';
},
}) Happy to accept a PR for that |
Beta Was this translation helpful? Give feedback.
Hey, we don't have anything for that today. Having to add middleware for that seems a bit cumbersome to me
What about allowing a function for
rootView
in theconfig/inertia.ts
file instead?Happy to accept a PR for that