From 9ebc4161678e64f173088ae4f7aeed8a41967503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Thu, 19 Sep 2024 18:19:57 +0800 Subject: [PATCH] =?UTF-8?q?Demo=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E8=8F=9C=E5=8D=95=E4=B8=AD=E7=9A=84=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=BC=9A=E8=B6=85=E5=87=BA=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Edit/components/Contextmenu.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/pages/Edit/components/Contextmenu.vue b/web/src/pages/Edit/components/Contextmenu.vue index 2110cfbc..c98f2418 100644 --- a/web/src/pages/Edit/components/Contextmenu.vue +++ b/web/src/pages/Edit/components/Contextmenu.vue @@ -344,12 +344,11 @@ export default { // 计算右键菜单元素的显示位置 getShowPosition(x, y) { - this.subItemsShowLeft = false const rect = this.$refs.contextmenuRef.getBoundingClientRect() if (x + rect.width > window.innerWidth) { x = x - rect.width - 20 - this.subItemsShowLeft = true } + this.subItemsShowLeft = x + rect.width + 150 > window.innerWidth if (y + rect.height > window.innerHeight) { y = window.innerHeight - rect.height - 10 }