From afe40b6a8944ecac93f42bd100a7f107595064e4 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 18 Feb 2020 20:52:00 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20NumInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/share/NumInput.vue | 38 +++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/client/components/share/NumInput.vue b/client/components/share/NumInput.vue index ebc1cdc9..5b816c60 100644 --- a/client/components/share/NumInput.vue +++ b/client/components/share/NumInput.vue @@ -10,23 +10,30 @@ @@ -65,6 +72,7 @@ export default @Component({ class NumInput extends NumInputProps { filteredValue = 0; error = false; + t = ''; created() { this.mask = '#'.repeat(this.max.toString().length); @@ -117,9 +125,27 @@ class NumInput extends NumInputProps { } onMouseUp() { + if (this.inTouch) + return; this.startClickRepeat = false; this.clickRepeat = false; } + + onTouchStart(event, way) { + if (!this.$isMobileDevice) + return; + if (event.touches.length == 1) { + this.inTouch = true; + this.onMouseDown({button: 0}, way); + } + } + + onTouchEnd() { + if (!this.$isMobileDevice) + return; + this.inTouch = false; + this.onMouseUp(); + } } //-----------------------------------------------------------------------------