From c9e87d73cd60c6cbd8e1cc9ea0ee9013121eb90d Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Fri, 18 Feb 2022 18:55:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DMock=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E9=9A=8F=E7=9D=80=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E8=87=AA=E5=8A=A8=E8=B0=83=E6=95=B4=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复Mock编辑页面不会随着浏览器窗口自动调整大小的问题 --- .../components/common/components/MsDrawer.vue | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/frontend/src/business/components/common/components/MsDrawer.vue b/frontend/src/business/components/common/components/MsDrawer.vue index 2247c18b6d..74fd8047cb 100644 --- a/frontend/src/business/components/common/components/MsDrawer.vue +++ b/frontend/src/business/components/common/components/MsDrawer.vue @@ -88,7 +88,11 @@ }, methods: { setfullScreen(){ - this.isFullScreen = true; + if(this.isFullScreen){ + this.fullScreen(); + }else { + this.isFullScreen = true; + } }, init() { window.addEventListener("resize", this.listenScreenChange,false); @@ -157,23 +161,28 @@ window.removeEventListener("resize", this.listenScreenChange); }, listenScreenChange() { - switch (this.direction) { - case 'left': - this.h = document.documentElement.clientHeight; - break; - case 'right': - this.h = document.documentElement.clientHeight; - break; - case 'top': - this.w = document.documentElement.clientWidth; - break; - case 'bottom': - this.w = document.documentElement.clientWidth; - break; - default: - this.h = document.documentElement.clientHeight; - this.w = document.documentElement.clientWidth; - break; + if(this.isFullScreen){ + this.w = document.body.clientWidth; + this.h = document.body.clientHeight; + }else { + switch (this.direction) { + case 'left': + this.h = document.documentElement.clientHeight; + break; + case 'right': + this.h = document.documentElement.clientHeight; + break; + case 'top': + this.w = document.documentElement.clientWidth; + break; + case 'bottom': + this.w = document.documentElement.clientWidth; + break; + default: + this.h = document.documentElement.clientHeight; + this.w = document.documentElement.clientWidth; + break; + } } } }