From 31ef3a47e08545cd52c25a326cc0658ad5ec9824 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 10 Nov 2022 14:03:38 +0800 Subject: [PATCH] no message --- .../js/components/DragBallComponent.vue | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/resources/assets/js/components/DragBallComponent.vue b/resources/assets/js/components/DragBallComponent.vue index fe4aab72f..33af5be0b 100644 --- a/resources/assets/js/components/DragBallComponent.vue +++ b/resources/assets/js/components/DragBallComponent.vue @@ -12,18 +12,10 @@ export default { type: String, default: "" }, - distanceLeft: { - type: Number, - default: -1 // 大于 -1 时 distanceRight 无效 - }, distanceRight: { type: Number, default: 0 }, - distanceTop: { - type: Number, - default: -1 // 大于 -1 时 distanceBottom 无效 - }, distanceBottom: { type: Number, default: 100 @@ -72,16 +64,8 @@ export default { this.left = window._DragBallComponent[this.id].left this.top = window._DragBallComponent[this.id].top } else { - if (this.distanceLeft > -1) { - this.left = this.distanceLeft; - } else { - this.left = this.clientWidth - this.floatDrag.offsetWidth - this.distanceRight; - } - if (this.distanceTop > -1) { - this.top = this.distanceTop; - } else { - this.top = this.clientHeight - this.floatDrag.offsetHeight - this.distanceBottom; - } + this.left = this.clientWidth - this.floatDrag.offsetWidth - this.distanceRight; + this.top = this.clientHeight - this.floatDrag.offsetHeight - this.distanceBottom; } this.initDraggable(); }); @@ -154,7 +138,7 @@ export default { handleResize() { this.clientWidth = document.documentElement.clientWidth; this.clientHeight = document.documentElement.clientHeight; - this.checkDraggablePosition(); + this.$nextTick(this.checkDraggablePosition); }, /**