Skip to content

useRoot

Get the root node. The root node is configurable in you nuxt.config.ts file (see docs). This will always get the "root" node configured.

The composable returns a computed property.

Requires the middleware option to be enabled.

In relation to this composable useCurrentSilo is often desirable.

Usage

vue
<script setup lang="ts">
const root = useRoot()

const navigation = computed(() => {
    return root.value?.properties?.navigation || []
})
</script>