Nuxt Layouts

up:: Nuxt Add in the layouts/ folder.

  • default.vue applies to any page
  • <slot /> indicates where the page content should go into. Using the definePageMeta(), you can define a layout to use.
	layout: "base"

Or you can hardcode it on the <NuxtLayout> component like so:

  <NuxtLayout :name="layout">
    <NuxtPage />
<script setup>
// You might choose this based on an API call or logged-in status
const layout = "custom";