From d8d1bcb92bdf528ae903c2551ef4abf74c20a95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 7 Sep 2021 11:09:41 +0800 Subject: [PATCH] Modal support fullscreen and draggable --- src/components/modal/modal.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index 5e86c6af..16f90b5c 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -199,7 +199,7 @@ `${prefixCls}-content`, { [`${prefixCls}-content-no-mask`]: !this.showMask, - [`${prefixCls}-content-drag`]: this.draggable, + [`${prefixCls}-content-drag`]: this.draggable && !this.fullscreen, [`${prefixCls}-content-dragging`]: this.draggable && this.dragData.dragging } ]; @@ -223,7 +223,7 @@ contentStyles () { let style = {}; - if (this.draggable) { + if (this.draggable && !this.fullscreen) { const customTop = this.styles.top ? parseFloat(this.styles.top) : 0; const customLeft = this.styles.left ? parseFloat(this.styles.left) : 0; if (this.dragData.x !== null) style.left = `${this.dragData.x - customLeft}px`; @@ -327,7 +327,7 @@ this.$emit('on-hidden'); }, handleMoveStart (event) { - if (!this.draggable) return false; + if (!this.draggable || this.fullscreen) return false; const $content = this.$refs.content; const rect = $content.getBoundingClientRect(); @@ -350,7 +350,7 @@ on(window, 'mouseup', this.handleMoveEnd); }, handleMoveMove (event) { - if (!this.dragData.dragging) return false; + if (!this.dragData.dragging || this.fullscreen) return false; const distance = { x: event.clientX,