From fe27adf73a8f7b0a2aa62c380c474fefde8f8056 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Sun, 18 Feb 2024 14:24:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=A6=96=E6=AC=A1=E5=8A=A0=E8=BD=BD=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/pages/panel/main.ts | 2 +- core/core-frontend/src/router/embedded.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 core/core-frontend/src/router/embedded.ts diff --git a/core/core-frontend/src/pages/panel/main.ts b/core/core-frontend/src/pages/panel/main.ts index 848eb31613..157461a9fc 100644 --- a/core/core-frontend/src/pages/panel/main.ts +++ b/core/core-frontend/src/pages/panel/main.ts @@ -60,7 +60,7 @@ import { setupStore } from '@/store' import { useEmbedded } from '@/store/modules/embedded' import { useUserStoreWithOut } from '@/store/modules/user' import { setupElementPlus, setupElementPlusIcons } from '@/plugins/element-plus' -import { setupRouter } from '@/router' +import { setupRouter } from '@/router/embedded' const setupAll = async ( dom: string, diff --git a/core/core-frontend/src/router/embedded.ts b/core/core-frontend/src/router/embedded.ts new file mode 100644 index 0000000000..908178909c --- /dev/null +++ b/core/core-frontend/src/router/embedded.ts @@ -0,0 +1,16 @@ +import { createRouter, createWebHashHistory } from 'vue-router' +import type { RouteRecordRaw } from 'vue-router' +import type { App } from 'vue' + +export const routes: AppRouteRecordRaw[] = [] + +const router = createRouter({ + history: createWebHashHistory(), + routes: routes as RouteRecordRaw[] +}) + +export const setupRouter = (app: App) => { + app.use(router) +} + +export default router