Skip to content

isCurrentRoute

Checks whether the current route name exactly matches the provided route name. This is the narrowest route helper and is useful for active states on single-route links.

Importing

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

Usage

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

const isDashboard = isCurrentRoute('dashboard');

Parameters

NameTypeDescription
routestringRoute name to compare against.

Returns

true when the current route name equals route.

Type signature

ts
declare function isCurrentRoute(route: string): boolean;

All packages are released under the MIT License.