Skip to content

getCurrentRouteName

Returns the current Vue Router route name as a string. If the route has no name, it returns an empty string so callers can safely compare without handling undefined.

Importing

ts
import { getCurrentRouteName } from '@almighty-shogun/vue-utils'

Usage

ts
import { getCurrentRouteName } from '@almighty-shogun/vue-utils'

const routeName = getCurrentRouteName();

Returns

The current route name or an empty string.

Type signature

ts
declare function getCurrentRouteName(): string;

All packages are released under the MIT License.