From 7d73c64d624afc918b97297f9e3aed177f931703 Mon Sep 17 00:00:00 2001 From: yupi <592789970@qq.com> Date: Fri, 16 Sep 2022 22:17:31 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=B8=B8=E6=88=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/configs/routes.ts | 5 +++ src/pages/ConfigPage.vue | 75 ++++++++++++++++++++++++++++++++++++++++ src/pages/GamePage.vue | 2 +- src/pages/IndexPage.vue | 8 +++-- 5 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 src/pages/ConfigPage.vue diff --git a/src/App.vue b/src/App.vue index 37ad403..2473673 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,7 +24,7 @@ #app { padding: 16px 16px 50px; background: url("assets/bg.jpeg"); - height: 100vh; + min-height: 100vh; background-size: 100% 100%; } diff --git a/src/configs/routes.ts b/src/configs/routes.ts index de29705..900b5b9 100644 --- a/src/configs/routes.ts +++ b/src/configs/routes.ts @@ -1,6 +1,7 @@ import { RouteRecordRaw } from "vue-router"; import IndexPage from "../pages/IndexPage.vue"; import GamePage from "../pages/GamePage.vue"; +import ConfigPage from "../pages/ConfigPage.vue"; export default [ { @@ -11,4 +12,8 @@ export default [ path: "/game", component: GamePage, }, + { + path: "/config", + component: ConfigPage, + }, ] as RouteRecordRaw[]; diff --git a/src/pages/ConfigPage.vue b/src/pages/ConfigPage.vue new file mode 100644 index 0000000..115448f --- /dev/null +++ b/src/pages/ConfigPage.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/pages/GamePage.vue b/src/pages/GamePage.vue index 573c78a..25e3adf 100644 --- a/src/pages/GamePage.vue +++ b/src/pages/GamePage.vue @@ -1,6 +1,6 @@ @@ -53,8 +53,10 @@ const { setGameConfig } = useGlobalStore(); const toGamePage = (config?: GameConfig) => { if (config) { setGameConfig(config); + router.push("/game"); + } else { + router.push("/config"); } - router.push("/game"); };