I can't seem to figure out how to retrieve the page title in Nuxt 3 and use it in a layout. I'm convinced that it must be possible through some kind of meta object, but I just can't seem to find it.
I attempted to access it through route meta
/layouts/default.vue
<template>
<h1>
{{ route.meta.title }}
</h1>
</template>
<script setup>
const route = useRoute();
</script>
However, now I have to set the title twice which is not ideal
/pages/catalog.vue
<script setup>
definePageMeta({
title: 'Catalog Page',
});
useHead({
title: 'Catalog Page',
});
</script>
This method seems quite hacky, so if anyone has other ideas, I am open to them