fix(frontend): router遷移時にmatchAllに入った場合一度location.hrefを経由するように (#13509)

* fix(frontend): router遷移時にmatchAllに入った場合一度`location.href`を経由するように

* Update Changelog

* Update CHANGELOG.md

* remove unnecessary args
This commit is contained in:
かっこかり 2024-03-05 17:27:33 +09:00 committed by GitHub
parent 83a5bc0ecd
commit 45672a70f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 9 deletions

View file

@ -4,7 +4,7 @@
-
### Client
-
- Fix: 一部のページ内リンクが正しく動作しない問題を修正
### Server
-

View file

@ -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 && res.route.path !== '/:(*)') {
this.emit('change', {
beforePath,
path,
@ -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 (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) {

View file

@ -48,6 +48,9 @@ const devConfig = {
},
'/url': httpUrl,
'/proxy': httpUrl,
'/_info_card_': httpUrl,
'/bios': httpUrl,
'/cli': httpUrl,
},
},
build: {