1
1
Component ( {
2
2
externalClasses : [
3
- 'l-class' ,
4
- 'l-symbol-class' ,
3
+ 'l-class' ,
4
+ 'l-symbol-class' ,
5
5
'l-count-class' ,
6
6
'l-disabled-class'
7
7
] ,
@@ -41,67 +41,76 @@ Component({
41
41
onBlur ( e ) {
42
42
let {
43
43
value
44
- } = e . detail
44
+ } = e . detail ;
45
45
setTimeout ( ( ) => {
46
- this . blurCount ( value )
47
- } , 50 )
46
+ this . blurCount ( value ) ;
47
+ } , 50 ) ;
48
48
} ,
49
49
50
50
blurCount ( value ) {
51
51
if ( value ) {
52
52
if ( value > this . properties . max ) this . setData ( {
53
53
count : this . properties . max
54
- } )
54
+ } ) ;
55
55
else if ( value < this . properties . min ) this . setData ( {
56
56
count : this . properties . min
57
- } )
57
+ } ) ;
58
58
else this . setData ( {
59
59
count : value
60
- } )
60
+ } ) ;
61
61
} else {
62
62
this . setData ( {
63
63
count : this . properties . count
64
- } )
64
+ } ) ;
65
65
}
66
66
let detail = {
67
67
count : this . data . count ,
68
68
type : 'blur'
69
- }
70
- this . triggerEvent ( 'lintap' , detail )
69
+ } ;
70
+ this . triggerEvent ( 'lintap' , detail , {
71
+ bubbles : true ,
72
+ composed : true
73
+ } ) ;
71
74
} ,
72
75
73
76
reduceTap ( ) {
74
- let distance = this . data . count - this . properties . step
77
+ let distance = this . data . count - this . properties . step ;
75
78
if ( distance <= this . properties . min ) {
76
- this . data . count = this . properties . min
79
+ this . data . count = this . properties . min ;
77
80
} else {
78
- this . data . count -= this . properties . step
81
+ this . data . count -= this . properties . step ;
79
82
}
80
83
this . setData ( {
81
84
count : this . data . count
82
- } )
85
+ } ) ;
83
86
let detail = {
84
87
count : this . data . count ,
85
88
type : 'reduce'
86
- }
87
- this . triggerEvent ( 'lintap' , detail )
89
+ } ;
90
+ this . triggerEvent ( 'lintap' , detail , {
91
+ bubbles : true ,
92
+ composed : true
93
+ } ) ;
88
94
} ,
89
95
90
96
addTap ( ) {
91
97
let distance = this . data . count + this . properties . step ;
92
98
if ( distance >= this . properties . max ) {
93
- this . data . count = this . properties . max
99
+ this . data . count = this . properties . max ;
94
100
} else {
95
101
this . data . count += this . properties . step ;
96
102
}
97
103
this . setData ( {
98
104
count : this . data . count
99
- } )
105
+ } ) ;
100
106
let detail = {
101
107
count : this . data . count ,
102
108
type : 'add'
103
- }
104
- this . triggerEvent ( 'lintap' , detail )
109
+ } ;
110
+ this . triggerEvent ( 'lintap' , detail , {
111
+ bubbles : true ,
112
+ composed : true
113
+ } ) ;
105
114
} ,
106
115
}
107
- } )
116
+ } ) ;
0 commit comments