diff --git a/core/core-frontend/src/router/embedded.ts b/core/core-frontend/src/router/embedded.ts index 23d088594d..2a1128b577 100644 --- a/core/core-frontend/src/router/embedded.ts +++ b/core/core-frontend/src/router/embedded.ts @@ -3,31 +3,22 @@ import type { RouteRecordRaw } from 'vue-router' import type { App } from 'vue' export const routes: AppRouteRecordRaw[] = [] -createRouter({ +const router = createRouter({ history: createWebHashHistory(), routes: routes as RouteRecordRaw[] }) -const fn = () => { - console.log('push') -} -const router = { - install: () => { - console.log('install') - }, - currentRoute: fn, - listening: true, - addRoute: fn, - removeRoute: fn, - hasRoute: fn, - getRoutes: fn, - resolve: fn, - options: fn, - push: fn, - replace: fn, - go: fn, - back: fn, - forward: fn +const rawInstall = router.install +router.install = app => { + const hash = window.location.hash + console.log('hash', hash) + rawInstall(app) + console.log('hash1', window.location.hash) + setTimeout(() => { + console.log('hash2', window.location.hash) + }, 300) + window.location.hash = hash + console.log('hash3', window.location.hash) } export const setupRouter = (app: App) => {