You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we may need to setup different layouts. Indeed this plugin provides a way to set route layout (with meta.layout in route block). However, we have to update files one by one in this way. It costs lots of time and energy to do so.
Expection
I am hoping that we make defaultLayout accept a function or a string, which the function can return a string by passed route. It looks like below:
importVuefrom'@vitejs/plugin-vue';importPagesfrom'vite-plugin-pages';importLayoutsfrom'vite-plugin-vue-layouts';exportdefault{plugins: [Vue(),Pages(),Layouts({defaultLayout: (route)=>{ ... },// return a string, like 'default' or 'myLayout'}),],};
I would like to listen to your thoughts.
Additon
I will be glad to submit a PR if you think this is valuable.I have no idea how to do this. Sorry.
The text was updated successfully, but these errors were encountered:
Background
Sometimes we may need to setup different layouts. Indeed this plugin provides a way to set route layout (with
meta.layout
in route block). However, we have to update files one by one in this way. It costs lots of time and energy to do so.Expection
I am hoping that we make
defaultLayout
accept a function or a string, which the function can return a string by passed route. It looks like below:I would like to listen to your thoughts.
Additon
I will be glad to submit a PR if you think this is valuable.I have no idea how to do this. Sorry.The text was updated successfully, but these errors were encountered: