Skip to content

Commit 9a87e64

Browse files
authored
[Doc] Tab: update demo (youzan#1603)
1 parent 3629642 commit 9a87e64

3 files changed

Lines changed: 29 additions & 26 deletions

File tree

example/pages/tab/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Page({
2222

2323
onClickNavRight() {
2424
wx.showToast({
25-
title: '点击right nav',
25+
title: '点击 right nav',
2626
icon: 'none'
2727
});
2828
},

example/pages/tab/index.wxml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,6 @@
1212
</van-tabs>
1313
</demo-block>
1414

15-
<demo-block title="自定义标题">
16-
<van-tabs active="{{ 1 }}" bind:change="onChange" tab-class="tab-class" tab-active-class="tab-active-class">
17-
<van-icon
18-
slot="nav-right"
19-
name="search"
20-
custom-class="right-nav"
21-
bind:click="onClickNavRight"
22-
/>
23-
<van-tab
24-
wx:for="1234"
25-
wx:key="index"
26-
title="{{ '标签' + item }}"
27-
dot="{{ index === 1 }}"
28-
info="{{ index === 2 ? 99 : null }}"
29-
>
30-
<view class="content">
31-
{{ '内容' + item }}
32-
</view>
33-
</van-tab>
34-
</van-tabs>
35-
</demo-block>
36-
3715
<demo-block title="横向滚动">
3816
<van-tabs>
3917
<van-tab
@@ -64,7 +42,7 @@
6442
</demo-block>
6543

6644
<demo-block title="样式风格">
67-
<van-tabs type="card">
45+
<van-tabs type="card" tab-class="tab-class" tab-active-class="tab-active-class">
6846
<van-tab
6947
wx:for="123"
7048
wx:key="index"
@@ -112,7 +90,7 @@
11290
wx:key="index"
11391
title="{{ '标签' + item }}"
11492
>
115-
<view class="content" style="height: 400px;">
93+
<view class="content">
11694
{{ '内容' + item }}
11795
</view>
11896
</van-tab>
@@ -132,3 +110,25 @@
132110
</van-tab>
133111
</van-tabs>
134112
</demo-block>
113+
114+
<demo-block title="自定义标题">
115+
<van-tabs active="{{ 1 }}" bind:change="onChange" tab-class="tab-class" tab-active-class="tab-active-class">
116+
<van-icon
117+
slot="nav-right"
118+
name="search"
119+
custom-class="right-nav"
120+
bind:click="onClickNavRight"
121+
/>
122+
<van-tab
123+
wx:for="1234"
124+
wx:key="index"
125+
title="{{ '标签' + item }}"
126+
dot="{{ index === 1 }}"
127+
info="{{ index === 2 ? 99 : null }}"
128+
>
129+
<view class="content">
130+
{{ '内容' + item }}
131+
</view>
132+
</van-tab>
133+
</van-tabs>
134+
</demo-block>

example/pages/tab/index.wxss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
page {
2+
padding-bottom: 300px;
3+
}
4+
15
.content {
26
padding: 20px;
37
background-color: #fff;
@@ -18,5 +22,4 @@
1822

1923
.tab-active-class {
2024
font-size: 1.05em !important;
21-
color: #1989fa !important;
2225
}

0 commit comments

Comments
 (0)