Custom classes for Type-safe handling of exceptions in your application.
npm install @fastkit/vue-locationLocation Service
A class for referencing and manipulating the state of vue-router.
(ctx: LocationServiceContext): LocationService| Name | Type | Default |
|---|---|---|
| ctx* | LocationServiceContext |
LocationServiceLocationServiceStateThe state of the location service
RouterRouter instance.
(): import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").RouteLocationNormalizedLoadedGenericThe currently active route
| Name | Type | Default |
|---|
RouteLocationNormalizedLoadedGenericThe currently active route
<Immediate extends Readonly<boolean> = false>(cb: WatchCallback<RouteLocationNormalizedLoaded, Immediate extends true ? RouteLocationNormalizedLoaded | undefined : RouteLocationNormalizedLoaded>, options?: WatchRouteOptions<Immediate>): WatchStopHandleWatching route transitions
| Name | Type | Default |
|---|---|---|
| cb* | WatchCallback<RouteLocationNormalizedLoadedGeneric, Immediate extends true ? RouteLocationNormalizedLoadedGeneric | undefined : RouteLocationNormalizedLoadedGeneric> | |
Callback function | ||
| options | WatchRouteOptions<Immediate> | undefined | |
Watch options | ||
WatchStopHandleStop function for the watcher
(): _RouteLocationBase | nullThe route location object that will be the destination when the route is in the process of transitioning
| Name | Type | Default |
|---|
null | _RouteLocationBaseThe route location object that will be the destination when the route is in the process of transitioning
(): LocationTransitioning | nullThe state of route transition
| Name | Type | Default |
|---|
null | LocationTransitioningThe state of route transition
(target: RouteLocationRaw): booleanChecks whether the specified location matches the current route.
| Name | Type | Default |
|---|---|---|
| target* | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | |
The location to be checked for a match with the current route. | ||
booleanReturns true if the specified location matches the current route, otherwise returns false.
(queries?: string | string[]): booleanCheck if the specified query is in the process of transitioning
| Name | Type | Default |
|---|---|---|
| queries | string | string[] | undefined | |
The query name or a list of queries to check | ||
booleanReturns true if it is in the process of transitioning
(raw?: RouteLocationRaw, opts?: SameRouteCheckOptions): booleanCheck if the specified route matches the current route
| Name | Type | Default |
|---|---|---|
| raw | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined | |
The route object to check | ||
| opts | SameRouteCheckOptions | undefined | |
booleanReturns true if it matches
(): RawRouteComponent[]Retrieve an array of components that match the currently active route
| Name | Type | Default |
|---|
RawRouteComponent[]An array of matching components
(raw: RouteLocationRaw): RawRouteComponent[]Get an array of components that match the specified route
| Name | Type | Default |
|---|---|---|
| raw* | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | |
The route object from which to extract components | ||
RawRouteComponent[]An array of matching components
(): booleanCheck if the current route is a valid route
This checks if there are one or more matching components.
| Name | Type | Default |
|---|
booleanCheck if the current route is a valid route
This checks if there are one or more matching components.
(raw?: RouteLocationRaw): booleanCheck if the specified route object is a valid route
| Name | Type | Default |
|---|---|---|
| raw | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined | |
The route object to check
This checks if there are one or more matching components. | ||
booleanCheck if the specified route object is a valid route
<Schema extends QueriesSchema>(schema: Schema): TypedQuery<Schema>Generate an interface for extracting and utility functions for query values corresponding to the specified schema:
| Name | Type | Default |
|---|---|---|
| schema* | Schema | |
Queries schema | ||
TypedQuery<Schema>An interface for extracting query values corresponding to a schema and utility functions
(key: string): string | undefined| Name | Type | Default |
|---|---|---|
| key* | string |
undefined | string(key: string, type: undefined, defaultValue: string): string| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | undefined | |
| defaultValue* | string |
string(key: string, type: StringConstructor): string | undefined| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | StringConstructor |
undefined | string(key: string, type: StringConstructor, defaultValue: string): string| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | StringConstructor | |
| defaultValue* | string |
string(key: string, type: NumberConstructor): number | undefined| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | NumberConstructor |
undefined | number(key: string, type: NumberConstructor, defaultValue: number): number| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | NumberConstructor | |
| defaultValue* | number |
number(key: string, type: BooleanConstructor): boolean| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | BooleanConstructor |
boolean(key: string, type: BooleanConstructor, defaultValue: boolean): boolean| Name | Type | Default |
|---|---|---|
| key* | string | |
| type* | BooleanConstructor | |
| defaultValue* | boolean |
boolean(query: LocationQueryRaw, route?: import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").RouteLocationNormalizedLoadedGeneric): _RouteLocationBase| Name | Type | Default |
|---|---|---|
| query* | LocationQueryRaw | |
| route | RouteLocationNormalizedLoadedGeneric | this.currentRoute |
_RouteLocationBase(to: string | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").RouteLocationAsRelativeGeneric | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").RouteLocationAsPathGeneric): Promise<...>| Name | Type | Default |
|---|---|---|
| args | [to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric] |
Promise<void | NavigationFailure | undefined>(query: LocationQueryRaw): Promise<void | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").NavigationFailure | undefined>| Name | Type | Default |
|---|---|---|
| query* | LocationQueryRaw |
Promise<void | NavigationFailure | undefined>(to: string | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").RouteLocationAsRelativeGeneric | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").RouteLocationAsPathGeneric): Promise<...>| Name | Type | Default |
|---|---|---|
| args | [to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric] |
Promise<void | NavigationFailure | undefined>(query: LocationQueryRaw): Promise<void | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.22_typescript@5.9.3_/node_modules/vue-router/dist/vue-router").NavigationFailure | undefined>| Name | Type | Default |
|---|---|---|
| query* | LocationQueryRaw |
Promise<void | NavigationFailure | undefined>(delta: number): void| Name | Type | Default |
|---|---|---|
| args | [delta: number] |
void(): void| Name | Type | Default |
|---|---|---|
| args | [] |
void(): void| Name | Type | Default |
|---|---|---|
| args | [] |
void