mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
[new feature] Tab: add scroll event (#1730)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('title2')">
|
||||
<van-tabs>
|
||||
<van-tabs sticky @scroll="subscribeSticky">
|
||||
<van-tab v-for="index in 8" :title="$t('tab') + index" :key="index">
|
||||
{{ $t('content') }} {{ index }}
|
||||
</van-tab>
|
||||
@@ -111,6 +111,10 @@ export default {
|
||||
|
||||
onClick(index, title) {
|
||||
this.$toast(title);
|
||||
},
|
||||
|
||||
subscribeSticky(e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -137,9 +141,11 @@ export default {
|
||||
.custom-tabwrap .van-tab-active {
|
||||
color: #20a0ff;
|
||||
}
|
||||
|
||||
.custom-tabwrap .van-tabs-nav-bar {
|
||||
background: #20a0ff;
|
||||
}
|
||||
|
||||
.custom-pane {
|
||||
text-align: center;
|
||||
height: 50px;
|
||||
|
@@ -169,3 +169,4 @@ In swipeable mode, you can switch tabs with swipe gestrue in the content
|
||||
| click | Triggered when click tab | index:index of current tab,title: tab title |
|
||||
| change | Triggered when active tab changed | index:index of current tab,title: tab title |
|
||||
| disabled | Triggered when click disabled tab | index:index of current tab, title: tab title |
|
||||
| scroll | Triggered when tab scroll | e:scroll arguments |
|
||||
|
@@ -171,3 +171,4 @@ export default {
|
||||
| click | 点击标签时触发 | index:标签索引,title:标题 |
|
||||
| change | 当前激活的标签改变时触发 | index:标签索引,title:标题 |
|
||||
| disabled | 点击被禁用的标签时触发 | index:标签索引,title:标题 |
|
||||
| scroll | 滚动时触发 | e:滚动参数 |
|
||||
|
Reference in New Issue
Block a user