From ce4c0faafc7121d576d07ca9c02c252ce9686ab6 Mon Sep 17 00:00:00 2001 From: oustn Date: Fri, 14 Jul 2017 11:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Slider=20=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E6=8C=89=E9=92=AE=E5=8D=95=E5=87=BB=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E5=80=BC=E8=B7=B3=E5=8A=A8=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/iview/iview/issues/1354 --- src/components/slider/slider.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/slider/slider.vue b/src/components/slider/slider.vue index ab8773b4..5574fa32 100644 --- a/src/components/slider/slider.vue +++ b/src/components/slider/slider.vue @@ -285,11 +285,12 @@ on(window, 'mouseup', this.onSingleDragEnd); }, onSingleDragStart (event) { - this.dragging = true; + this.dragging = false; this.startX = event.clientX; this.startPos = parseInt(this.singlePosition, 10); }, onSingleDragging (event) { + this.dragging = true; if (this.dragging) { this.$refs.tooltip.visible = true; this.currentX = event.clientX; @@ -305,9 +306,9 @@ this.changeSinglePosition(this.newPos); // window.removeEventListener('mousemove', this.onSingleDragging); // window.removeEventListener('mouseup', this.onSingleDragEnd); - off(window, 'mousemove', this.onSingleDragging); - off(window, 'mouseup', this.onSingleDragEnd); } + off(window, 'mousemove', this.onSingleDragging); + off(window, 'mouseup', this.onSingleDragEnd); }, changeSinglePosition (newPos) { if (newPos < 0) { @@ -348,11 +349,12 @@ on(window, 'mouseup', this.onFirstDragEnd); }, onFirstDragStart (event) { - this.firstDragging = true; + this.firstDragging = false; this.startX = event.clientX; this.startPos = parseInt(this.firstPosition, 10); }, onFirstDragging (event) { + this.firstDragging = true; if (this.firstDragging) { this.$refs.tooltip.visible = true; this.currentX = event.clientX; @@ -368,9 +370,9 @@ this.changeFirstPosition(this.newPos); // window.removeEventListener('mousemove', this.onFirstDragging); // window.removeEventListener('mouseup', this.onFirstDragEnd); - off(window, 'mousemove', this.onFirstDragging); - off(window, 'mouseup', this.onFirstDragEnd); } + off(window, 'mousemove', this.onFirstDragging); + off(window, 'mouseup', this.onFirstDragEnd); }, changeFirstPosition (newPos) { if (newPos < 0) { @@ -405,11 +407,12 @@ on(window, 'mouseup', this.onSecondDragEnd); }, onSecondDragStart (event) { - this.secondDragging = true; + this.secondDragging = false; this.startX = event.clientX; this.startPos = parseInt(this.secondPosition, 10); }, onSecondDragging (event) { + this.secondDragging = true; if (this.secondDragging) { this.$refs.tooltip2.visible = true; this.currentX = event.clientX; @@ -425,9 +428,9 @@ this.changeSecondPosition(this.newPos); // window.removeEventListener('mousemove', this.onSecondDragging); // window.removeEventListener('mouseup', this.onSecondDragEnd); - off(window, 'mousemove', this.onSecondDragging); - off(window, 'mouseup', this.onSecondDragEnd); } + off(window, 'mousemove', this.onSecondDragging); + off(window, 'mouseup', this.onSecondDragEnd); }, changeSecondPosition (newPos) { if (newPos > 100) {