File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 4
4
<view class =" u-demo-title" >演示效果</view >
5
5
<view class =" u-demo-area" >
6
6
<u-toast ref =" uToast" ></u-toast >
7
- <u-tabs v-if =" control" bg-color =" #fafafa" :bold =" bold" :active-color =" activeColor" :list =" list"
8
- @change =" change" :current =" current" :is-scroll =" isScroll" ></u-tabs >
7
+ <u-tabs v-if =" control" bg-color =" #fafafa" :bold =" bold" :active-color =" activeColor" :list =" list"
8
+ @change =" change" :current =" current" :is-scroll =" isScroll" :offset = " offset " ></u-tabs >
9
9
</view >
10
10
</view >
11
11
<view class =" u-config-wrap" >
38
38
return {
39
39
list: [],
40
40
data: [{
41
- name: ' 关注'
41
+ name: ' 关注' ,
42
+ count: 100
42
43
}, {
43
- name: ' 推荐'
44
+ name: ' 推荐' ,
45
+ count: 7
44
46
}, {
45
47
name: ' 电影'
46
48
},{
62
64
tabCountIndex: 0 ,
63
65
activeColor: this .$u .color [' primary' ],
64
66
bold: true ,
65
- control: true
67
+ control: true ,
68
+ offset: [5 , - 5 ]
66
69
}
67
70
},
68
71
onLoad () {
75
78
this .list = [];
76
79
this .list .push (this .data [0 ]);
77
80
this .list .push (this .data [1 ]);
81
+ this .offset = [5 , 60 ]
78
82
} else if (index == 1 ) {
79
83
this .list = [];
80
84
this .list .push (this .data [0 ]);
81
85
this .list .push (this .data [1 ]);
82
86
this .list .push (this .data [2 ]);
87
+ this .offset = [5 , 20 ]
83
88
} else {
84
89
this .list = [];
85
90
this .list .push (this .data [0 ]);
86
91
this .list .push (this .data [1 ]);
87
92
this .list .push (this .data [2 ]);
88
93
this .list .push (this .data [3 ]);
94
+ this .offset = [5 , 5 ]
89
95
}
90
96
this .tabCountIndex = index;
91
97
this .isScroll = false ;
99
105
if (index == 0 ) {
100
106
this .isScroll = true ;
101
107
this .list = this .data ;
108
+ this .offset = [5 , - 5 ]
102
109
} else {
103
110
this .isScroll = false ;
104
111
this .countChange (this .tabCountIndex );
135
142
136
143
<style lang="scss" scoped>
137
144
.u-config-wrap {
138
-
145
+
139
146
}
140
147
</style >
Original file line number Diff line number Diff line change @@ -278,7 +278,8 @@ export default {
278
278
name: ' 待收货'
279
279
},
280
280
{
281
- name: ' 待评价'
281
+ name: ' 待评价' ,
282
+ count: 12
282
283
}
283
284
],
284
285
current: 0 ,
You can’t perform that action at this time.
0 commit comments