From a2c5781120ca664dd42836dddd323438ff04de84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BD=B3?= Date: Tue, 20 Aug 2019 18:40:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9moadl=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=20style=20=E9=AB=98=E5=BA=A6=E4=B8=8E=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E5=90=8E=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E9=A3=98=E7=A7=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/modal/modal.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index 3c62366d..e07eae89 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -199,8 +199,9 @@ let style = {}; if (this.draggable) { + let customTop = this.styles.top ? parseFloat(this.styles.top) : 0 if (this.dragData.x !== null) style.left = `${this.dragData.x}px`; - if (this.dragData.y !== null) style.top = `${this.dragData.y}px`; + if (this.dragData.y !== null) style.top = `${this.dragData.y - customTop}px`; const width = parseInt(this.width); const styleWidth = { width: width <= 100 ? `${width}%` : `${width}px`