Nuxt Layouts
up:: Nuxt ⚐
Add in the layouts/ folder.
default.vueapplies to any page<slot />indicates where the page content should go into. Using thedefinePageMeta(), you can define a layout to use.
definePageMeta({
layout: "base"
})Or you can hardcode it on the <NuxtLayout> component like so:
<template>
<NuxtLayout :name="layout">
<NuxtPage />
</NuxtLayout>
</template>
<script setup>
// You might choose this based on an API call or logged-in status
const layout = "custom";
</script>