Skip to content

Commit 706441a

Browse files
committed
build: Travis CI automatic compilation
1 parent 04b0d92 commit 706441a

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
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: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import hover from '../behaviors/hover';
2+
import eventUtil from '../core/utils/event-util';
23

34
Component({
45
behaviors: [hover],
@@ -39,9 +40,12 @@ Component({
3940
},
4041

4142
observers: {
43+
'result': function (count) {
44+
eventUtil.emit(this, 'linchange', { count });
45+
},
4246
'count,min,max': function () {
4347
this.valueRange(this.data.count, 'parameter');
44-
}
48+
},
4549
},
4650

4751
/**
@@ -50,10 +54,7 @@ Component({
5054
methods: {
5155
doNothing(e) {
5256
const { type } = e.currentTarget.dataset;
53-
this.triggerEvent('linout', { type, way: 'icon' }, {
54-
bubbles: true,
55-
composed: true
56-
});
57+
eventUtil.emit(this, 'linout', { type, way: 'icon' });
5758
},
5859

5960
onCount() {
@@ -72,13 +73,7 @@ Component({
7273
setTimeout(() => {
7374
this.blurCount(Number(value), () => {
7475
this.data.count = this.data.result;
75-
this.triggerEvent('lintap', {
76-
count: this.data.result,
77-
type: 'blur'
78-
}, {
79-
bubbles: true,
80-
composed: true
81-
});
76+
eventUtil.emit(this, 'lintap', { count: this.data.result, type: 'blur' });
8277
});
8378
}, 50);
8479
},
@@ -99,19 +94,13 @@ Component({
9994
this.setData({
10095
result: this.properties.max
10196
}, () => {
102-
this.triggerEvent('linout', { type: 'overflow_max', way }, {
103-
bubbles: true,
104-
composed: true
105-
});
97+
eventUtil.emit(this, 'linout', { type: 'overflow_max', way });
10698
});
10799
} else if (value < this.properties.min) {
108100
this.setData({
109101
result: this.properties.min
110102
}, () => {
111-
this.triggerEvent('linout', { type: 'overflow_min', way }, {
112-
bubbles: true,
113-
composed: true
114-
});
103+
eventUtil.emit(this, 'linout', { type: 'overflow_min', way });
115104
});
116105
} else {
117106
this.setData({
@@ -158,4 +147,4 @@ Component({
158147
});
159148
},
160149
}
161-
});
150+
});

0 commit comments

Comments
 (0)