I have a different layout for the public part of my website and a different layout for the admin area.
Currently I'm using
definePageMeta({layout: 'admin'})
How can I set the admin layout for all pages within the pages/admin directory or based upon the route admin, admin/** without having to specify it for every page individually?
If I understood your question correctly, it's achievable by calling the
NuxtLayoutinside pages route, like this.Any routes inside the admin folder will have the admin layout
~/pages/admin.vuePages directory example would be something like this. The
index.vueinside the admin folder is your admin page content.Admin layout example.
~/layouts/admin.vueHope this helps. Tested and it works