Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fdb3003

Browse files
committed
fix: Fix context check for potential errors
1 parent c223ebd commit fdb3003

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎src/router-service.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ export class RouterService {
125125
this.frame = frame;
126126

127127
this.routerGuardsService = new RouterGuardsService({
128-
to: "",
129-
from: "",
128+
to: null,
129+
from: null,
130130
});
131131
}
132132

@@ -540,14 +540,14 @@ export class RouterService {
540540
return false;
541541
}
542542

543-
if (typeofcontext ==="object"||typeofcontext==="string") {
544-
this.navigateTo(context);
543+
if (context instanceofError) {
544+
this.onError(context);
545545

546546
return false;
547547
}
548548

549-
if (context instanceofError) {
550-
this.onError(context);
549+
if (typeofcontext ==="object"||typeofcontext==="string") {
550+
this.navigateTo(context);
551551

552552
return false;
553553
}

‎src/typings/router-service.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface RouteOptions extends NavigationEntryVue {
3333

3434
export interface Route extends RouteOptions {
3535
path: string;
36-
name?: string;
36+
name?: RouteRecordName|null|undefined;
3737
component?: Component;
3838
children?: RouteChildren;
3939

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /