containsRoutePrefix
Checks whether the current route name starts with a prefix. This is useful for grouping route names by feature area, such as settings.profile and settings.security.
Importing
ts
import { containsRoutePrefix } from '@almighty-shogun/vue-utils'Usage
ts
import { containsRoutePrefix } from '@almighty-shogun/vue-utils'
const isSettingsPage = containsRoutePrefix('settings.');Parameters
| Name | Type | Description |
|---|---|---|
prefix | string | Route name prefix. |
Returns
true when the current route name starts with prefix.
Type signature
ts
declare function containsRoutePrefix(prefix: string): boolean;