From 6c7c17cd618ab6e219bd1af8017358888120c6d4 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 3 Jun 2022 11:41:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=94=E5=9B=9E=E6=89=8B?= =?UTF-8?q?=E5=8A=BF=E6=8A=96=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/components/Mobile/Back.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/Mobile/Back.vue b/resources/assets/js/components/Mobile/Back.vue index 01deebae4..9fbf47ef9 100644 --- a/resources/assets/js/components/Mobile/Back.vue +++ b/resources/assets/js/components/Mobile/Back.vue @@ -44,11 +44,14 @@ export default { }, computed: { - ...mapState(['windowScrollY']), + ...mapState(['windowHeight', 'windowScrollY']), style() { + const offset = 135; + const top = Math.max(offset, this.y) + this.windowScrollY, + maxTop = this.windowHeight - offset; return { - top: (this.y + this.windowScrollY) + 'px', + top: Math.min(top, maxTop) + 'px', left: this.x > 20 ? 0 : '-50px', } },