Skip to content

Commit 8e8d97f

Browse files
committed
新增:tabs标签卡增加badge徽标数设置
1 parent 6a276a4 commit 8e8d97f

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

pages/componentsA/tabs/index.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
66
<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>
99
</view>
1010
</view>
1111
<view class="u-config-wrap">
@@ -38,9 +38,11 @@
3838
return {
3939
list: [],
4040
data: [{
41-
name: '关注'
41+
name: '关注',
42+
count: 100
4243
}, {
43-
name: '推荐'
44+
name: '推荐',
45+
count: 7
4446
}, {
4547
name: '电影'
4648
},{
@@ -62,7 +64,8 @@
6264
tabCountIndex: 0,
6365
activeColor: this.$u.color['primary'],
6466
bold: true,
65-
control: true
67+
control: true,
68+
offset: [5, -5]
6669
}
6770
},
6871
onLoad() {
@@ -75,17 +78,20 @@
7578
this.list = [];
7679
this.list.push(this.data[0]);
7780
this.list.push(this.data[1]);
81+
this.offset = [5, 60]
7882
} else if(index == 1) {
7983
this.list = [];
8084
this.list.push(this.data[0]);
8185
this.list.push(this.data[1]);
8286
this.list.push(this.data[2]);
87+
this.offset = [5, 20]
8388
} else {
8489
this.list = [];
8590
this.list.push(this.data[0]);
8691
this.list.push(this.data[1]);
8792
this.list.push(this.data[2]);
8893
this.list.push(this.data[3]);
94+
this.offset = [5, 5]
8995
}
9096
this.tabCountIndex = index;
9197
this.isScroll = false;
@@ -99,6 +105,7 @@
99105
if(index == 0) {
100106
this.isScroll = true;
101107
this.list = this.data;
108+
this.offset = [5, -5]
102109
} else {
103110
this.isScroll = false;
104111
this.countChange(this.tabCountIndex);
@@ -135,6 +142,6 @@
135142

136143
<style lang="scss" scoped>
137144
.u-config-wrap {
138-
145+
139146
}
140147
</style>

pages/template/order/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ export default {
278278
name: '待收货'
279279
},
280280
{
281-
name: '待评价'
281+
name: '待评价',
282+
count: 12
282283
}
283284
],
284285
current: 0,

0 commit comments

Comments
 (0)