Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘文虎
account-book
Commits
9335e21d
Commit
9335e21d
authored
Nov 09, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改布进器
parent
e7098dec
Pipeline
#3968
canceled with stages
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
number-box - 副本.vue
components/number-box/number-box - 副本.vue
+0
-0
number-box.vue
components/number-box/number-box.vue
+9
-11
No files found.
components/number-box/number-box - 副本.vue
0 → 100644
View file @
9335e21d
This diff is collapsed.
Click to expand it.
components/number-box/number-box.vue
View file @
9335e21d
...
...
@@ -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
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment