Skip to content

Commit 3a32e85

Browse files
committed
build: Travis CI automatic compilation
1 parent 949e500 commit 3a32e85

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

dist/counter/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dist/counter/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Component({
2424
type: Number,
2525
value: 1
2626
},
27+
roundFloat: {
28+
type: Boolean,
29+
value: false
30+
},
2731
disabled: Boolean,
2832
iconSize: String,
2933
iconColor: String
@@ -62,6 +66,7 @@ Component({
6266
let {
6367
value
6468
} = e.detail;
69+
// setTimeout留出修改count的时间,保证调整一些不合适的数值
6570
setTimeout(() => {
6671
this.blurCount(Number(value), () => {
6772
eventUtil.emit(this, 'lintap', { count: this.data.count, type: 'blur' });
@@ -91,6 +96,10 @@ Component({
9196
value = value > max ? max : value;
9297
value = value < min ? min : value;
9398

99+
// 4舍5入
100+
if (this.data.roundFloat) {
101+
value = Math.round(value);
102+
}
94103
// 更新页面显示数值
95104
value === this.data.count && this.setData({ focus: false });
96105
value !== this.data.count && this.setData({ count: value }, () => {

0 commit comments

Comments
 (0)