The useRouteBaseName()
composable returns a function that gets the route's base name.
declare function useRouteBaseName(
options?: I18nCommonRoutingOptionsWithComposable
): (givenRoute?: Route | RouteLocationNormalizedLoaded) => string | undefined
<script setup>
const route = useRoute()
const getRouteBaseName = useRouteBaseName()
const baseRouteName = computed(() => {
return getRouteBaseName(route)
})
</script>
<template>
<p>route base name: {{ baseRouteName }}</p>
</template>