-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(frontend): router遷移時にmatchAllに入った場合一度location.href
を経由するように
#13509
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
23c7d1f
fix(frontend): router遷移時にmatchAllに入った場合一度`location.href`を経由するように
kakkokari-gtyih 6d9b76d
Update Changelog
kakkokari-gtyih 486e7ef
Update CHANGELOG.md
kakkokari-gtyih aa42f01
Merge branch 'develop' into fix-13490
kakkokari-gtyih ea0cebd
remove unnecessary args
kakkokari-gtyih File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
- | ||
|
||
### Client | ||
- | ||
- Fix: 一部のページ内リンクが正しく動作しない問題を修正 | ||
|
||
### Server | ||
- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -337,7 +337,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter { | |
return check(this.routes, _parts); | ||
} | ||
|
||
private navigate(path: string, key: string | null | undefined, emitChange = true, _redirected = false): Resolved { | ||
private navigate(path: string, key: string | null | undefined, emitChange: boolean | 'whenFound' = 'whenFound', _redirected = false): Resolved { | ||
const beforePath = this.currentPath; | ||
this.currentPath = path; | ||
|
||
|
@@ -373,7 +373,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter { | |
this.currentRoute.value = res.route; | ||
this.currentKey = res.route.globalCacheKey ?? key ?? path; | ||
|
||
if (emitChange) { | ||
if (emitChange === true || (emitChange === 'whenFound' && res.route.path !== '/:(*)')) { | ||
this.emit('change', { | ||
beforePath, | ||
path, | ||
|
@@ -397,7 +397,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter { | |
return this.currentKey; | ||
} | ||
|
||
public push(path: string, flag?: any) { | ||
public push(path: string, flag?: any, useBrowserWhenNotFound = true) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 引数追加する必要性あるかしら There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ないかも There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. けした |
||
const beforePath = this.currentPath; | ||
if (path === beforePath) { | ||
this.emit('same'); | ||
|
@@ -408,13 +408,17 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter { | |
if (cancel) return; | ||
} | ||
const res = this.navigate(path, null); | ||
this.emit('push', { | ||
beforePath, | ||
path: res._parsedRoute.fullPath, | ||
route: res.route, | ||
props: res.props, | ||
key: this.currentKey, | ||
}); | ||
if (useBrowserWhenNotFound && res.route.path === '/:(*)') { | ||
location.href = path; | ||
} else { | ||
this.emit('push', { | ||
beforePath, | ||
path: res._parsedRoute.fullPath, | ||
route: res.route, | ||
props: res.props, | ||
key: this.currentKey, | ||
}); | ||
} | ||
} | ||
|
||
public replace(path: string, key?: string | null) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ変える必要あるかしら
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matchAllのときでもルート遷移は発生してしまうのでそれを防止するオプションが
whenFound
だけどそれをemitChangeのデフォルト動作にしてしまってもいいかThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうした