Commit 9335e21d authored by 刘文虎's avatar 刘文虎

修改布进器

parent e7098dec
Pipeline #3968 canceled with stages
This diff is collapsed.
......@@ -2,8 +2,7 @@
<view class="u-numberbox">
<view
class="u-icon-minus"
@touchstart.stop.prevent="btnTouchStart('minus')"
@touchend.stop.prevent="clearTimer"
@tap.stop.prevent="btnTouchStart('minus')"
:class="{ 'u-icon-disabled': disabled || inputVal <= min }"
:style="{
background: '#ffffff',
......@@ -20,8 +19,7 @@
@blur="onBlur" @focus="onFocus" type="digit" :style="{ color: '#333333', fontSize: size + 'rpx', height: inputHeight + 'rpx', width: inputWidth + 'rpx'}" v-if="showMinus" />
<view
class="u-icon-plus"
@touchstart.stop.prevent="btnTouchStart('plus')"
@touchend.stop.prevent="clearTimer"
@tap.stop.prevent="btnTouchStart('plus')"
:class="{ 'u-icon-disabled': disabled || inputVal >= max }"
:style="{
background: themeColors,
......@@ -227,13 +225,13 @@ export default {
// 先执行一遍方法,否则会造成松开手时,就执行了clearTimer,导致无法实现功能
this[callback]();
// 如果没开启长按功能,直接返回
if (!this.longPress) return;
clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
this.timer = null;
this.timer = setInterval(() => {
// 执行加或减函数
this[callback]();
}, this.pressTime);
// if (!this.longPress) return;
// clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
// this.timer = null;
// this.timer = setInterval(() => {
// // 执行加或减函数
// this[callback]();
// }, this.pressTime);
},
clearTimer() {
this.$nextTick(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment