From e64ac154621917864fd6d828cf3310f5e65bb4c8 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Mon, 9 Aug 2021 11:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=BB=98=E8=AE=A4=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=EF=BC=8C=E8=B0=83=E6=95=B4=E6=A8=AA=E7=AB=96=E5=B1=8F?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quasar.conf.js | 2 +- src/layouts/MainLayout.vue | 35 ++++++++++++++++++++++++++++++++--- src/pages/Login.vue | 13 +++++++++++-- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/quasar.conf.js b/quasar.conf.js index e70f606..05a0120 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -77,7 +77,7 @@ module.exports = configure(function (ctx) { config: {}, // iconSet: 'material-icons', // Quasar icon set - // lang: 'en-US', // Quasar language pack + lang: "zh-CN", // Quasar language pack // For special cases outside of where the auto-import strategy can have an impact // (like functional components as one of the examples), diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index bbe04be..07e813c 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -1,18 +1,37 @@ @@ -21,6 +40,7 @@ import { defineComponent, reactive } from "vue"; import LeftToolBar from "src/pages/LeftToolBar.vue"; import TopToolBar from "src/pages/TopToolBar.vue"; +import EventBus, { EventNamesDefine } from "src/common/EventBus"; class _Data { show_left_drawer = true; @@ -35,7 +55,16 @@ export default defineComponent({ setup() { const data = reactive(new _Data()); - return { data }; + const landspace = window.innerHeight < window.innerWidth; + + EventBus.getInstance().on(EventNamesDefine.WindowResize, () => { + const new_landspace = window.innerHeight < window.innerWidth; + if (landspace != new_landspace) { + window.location.reload(); + } + }); + + return { data, landspace }; }, }); diff --git a/src/pages/Login.vue b/src/pages/Login.vue index e2c02d3..eaaa8ef 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -2,7 +2,7 @@ - + {{ $t("login") }} @@ -99,7 +99,7 @@