File tree Expand file tree Collapse file tree 6 files changed +23
-5
lines changed
examples/dist/count-selector Expand file tree Collapse file tree 6 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ Component({
8
8
properties : {
9
9
count : {
10
10
type : Number ,
11
- value : 1
11
+ value : 1 ,
12
+ observer : 'changeCount'
12
13
} ,
13
14
max : {
14
15
type : Number ,
@@ -62,6 +63,10 @@ Component({
62
63
} , 50 ) ;
63
64
} ,
64
65
66
+ changeCount ( ) {
67
+ this . blurCount ( this . properties . count ) ;
68
+ } ,
69
+
65
70
blurCount ( value ) {
66
71
if ( value ) {
67
72
if ( value > this . properties . max ) this . setData ( {
Original file line number Diff line number Diff line change 1
- .container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;min-height:56rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}
1
+ .container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;min-height:56rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ Component({
8
8
properties : {
9
9
count : {
10
10
type : Number ,
11
- value : 1
11
+ value : 1 ,
12
+ observer : 'changeCount'
12
13
} ,
13
14
max : {
14
15
type : Number ,
@@ -62,6 +63,10 @@ Component({
62
63
} , 50 ) ;
63
64
} ,
64
65
66
+ changeCount ( ) {
67
+ this . blurCount ( this . properties . count ) ;
68
+ } ,
69
+
65
70
blurCount ( value ) {
66
71
if ( value ) {
67
72
if ( value > this . properties . max ) this . setData ( {
Original file line number Diff line number Diff line change 1
- .container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;min-height:56rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}
1
+ .container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;min-height:56rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ Component({
8
8
properties : {
9
9
count : {
10
10
type : Number ,
11
- value : 1
11
+ value : 1 ,
12
+ observer : 'changeCount'
12
13
} ,
13
14
max : {
14
15
type : Number ,
@@ -62,6 +63,10 @@ Component({
62
63
} , 50 ) ;
63
64
} ,
64
65
66
+ changeCount ( ) {
67
+ this . blurCount ( this . properties . count ) ;
68
+ } ,
69
+
65
70
blurCount ( value ) {
66
71
if ( value ) {
67
72
if ( value > this . properties . max ) this . setData ( {
Original file line number Diff line number Diff line change 33
33
background : #f6f7f9 ;
34
34
margin : 0 4 rpx;
35
35
text-align : center ;
36
+ overflow : hidden ;
37
+ text-overflow : ellipsis ;
38
+ white-space : nowrap ;
36
39
}
You can’t perform that action at this time.
0 commit comments