feat(frontend/nirax): リダイレクトを設定できるように (#13030)

* feat(frontend/nirax): リダイレクトを設定できるように

* revert demonstrative changes

* fix

* revert unrelated changes

* リダイレクトの際にパスが変わらない問題を修正

* リダイレクトが必要なrouteを設定

* fix lint

* router向けe2eテストの追加

* fix

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Co-authored-by: samunohito <46447427+samunohito@users.noreply.github.com>
This commit is contained in:
かっこかり 2024-01-28 19:22:38 +09:00 committed by GitHub
parent fe7036a1a8
commit b62d9f3920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 131 additions and 16 deletions

View file

@ -93,6 +93,13 @@ windowRouter.addListener('push', ctx => {
history.value.push({ path: ctx.path, key: ctx.key });
});
windowRouter.addListener('replace', ctx => {
history.value.pop();
history.value.push({ path: ctx.path, key: ctx.key });
});
windowRouter.init();
provide('router', windowRouter);
provideMetadataReceiver((info) => {
pageMetadata.value = info;