Skip to content

Commit 45672a7

Browse files
fix(frontend): router遷移時にmatchAllに入った場合一度location.hrefを経由するように (#13509)
* fix(frontend): router遷移時にmatchAllに入った場合一度`location.href`を経由するように * Update Changelog * Update CHANGELOG.md * remove unnecessary args
1 parent 83a5bc0 commit 45672a7

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-
55

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

99
### Server
1010
-

packages/frontend/src/nirax.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
373373
this.currentRoute.value = res.route;
374374
this.currentKey = res.route.globalCacheKey ?? key ?? path;
375375

376-
if (emitChange) {
376+
if (emitChange && res.route.path !== '/:(*)') {
377377
this.emit('change', {
378378
beforePath,
379379
path,
@@ -408,13 +408,17 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
408408
if (cancel) return;
409409
}
410410
const res = this.navigate(path, null);
411-
this.emit('push', {
412-
beforePath,
413-
path: res._parsedRoute.fullPath,
414-
route: res.route,
415-
props: res.props,
416-
key: this.currentKey,
417-
});
411+
if (res.route.path === '/:(*)') {
412+
location.href = path;
413+
} else {
414+
this.emit('push', {
415+
beforePath,
416+
path: res._parsedRoute.fullPath,
417+
route: res.route,
418+
props: res.props,
419+
key: this.currentKey,
420+
});
421+
}
418422
}
419423

420424
public replace(path: string, key?: string | null) {

packages/frontend/vite.config.local-dev.ts

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ const devConfig = {
4848
},
4949
'/url': httpUrl,
5050
'/proxy': httpUrl,
51+
'/_info_card_': httpUrl,
52+
'/bios': httpUrl,
53+
'/cli': httpUrl,
5154
},
5255
},
5356
build: {

0 commit comments

Comments
 (0)