Ensure Inertia pages are children of AppLayout#1517
Ensure Inertia pages are children of AppLayout#1517mst101 wants to merge 1 commit intolaravel:5.xfrom
Conversation
|
I'm not sure I follow. How is |
|
If you have a look at Vue DevTools, this shows the current hierarchy of components: This PR adjusts things, like so: If you check out this repo, you'll see why this could be an issue: https://github.com/mst101/jetstream-bug e.g. Imagine you're on the Dashboard page and you write some text in an input field in the nav. You then click on the 'Profile' page... and find that the input text you entered has been overwritten (because the site has reloaded That's perfectly normal behaviour for a traditional server-side app of course. But it needn't be for an SPA. |
|
A point of feedback from creator of Inertia:
|
|
Please mark as ready for review when the requested changes have been made. |
|
This is still actual. Default Inertia user profile page (Show) is parrent to AppLayout. |


I noticed that the
AppLayout.vuecomponent is currently a child of the following pages:This means the whole layout is refreshed when clicking between these pages. Not only is this inefficient, but any custom code in the navigation bar (e.g. a search input field) will have its content reset.
This PR solves this problem by providing a wrapper around
AppLayoutand makes use of thedefineOptionsmacro:... to ensure that the above vue components are children of
AppLayout.vue, not the other way around.