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
| Name | Type | Description |
|---|---|---|
route | string | Route name to compare against. |
Returns
true when the current route name equals route.
Type signature
ts
declare function isCurrentRoute(route: string): boolean;