更新记录
1.0.0(2021-01-20)
下载此版本
tabs 与swiper联动
平台兼容性
uni-app
app-vue |
app-nvue |
app-android |
app-ios |
app-harmony |
? |
? |
? |
? |
? |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
? |
? |
? |
? |
? |
? |
? |
? |
? |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
? |
? |
? |
? |
? |
? |
? |
? |
? |
uni-app x
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
? |
? |
? |
? |
? |
? |
? |
? |
? |
tab与swiper联动切换
引入
import hyxTabs from "@/components/hyx-tabs/hyx-tabs.vue";
export default {
components: {
hyxTabs
},
data() {
return {
activeTab: 0,
config:{
key: 'title',
},
dataList: [{
title: '全部',
list: [{
"name": "1"
}]
},{
title: '热门推荐',
list: [{
"name": "2"
}]
},{
title: '热门推荐',
list: [{
"name": "3"
}]
},{
title: '热门推荐',
list: [{
"name": "4"
}]
},{
title: '热门推荐',
list: [{
"name": "5"
}]
},{
title: '热门推荐',
list: [{
"name": "6"
}]
},{
title: '热门推荐',
list: [{
"name": "7"
}]
},{
title: '热门推荐',
list: [{
"name": "8"
}]
},{
title: '热门推荐',
list: [{
"name": "9"
}]
},{
title: '热门推荐',
list: [{
"name": "10"
}]
}]
};
},
methods: {
choseTab(index) {
this.activeTab = index;
},
change(e){
this.activeTab = e.detail.current;
this.$refs.child.tabToIndex(this.activeTab)
}
}
}
页面引用
<hyx-tabs ref="child" :tabData="dataList" :activeIndex="activeTab" @tabClick='choseTab' :config='config' />
<swiper class="swiper" :current="activeTab" @change="change">
<swiper-item class="swiper-item" v-for="(item,index) in dataList" :key="index">
<view class="li" v-for="(v,i) in item.list">
{{v.name}}
</view>
</swiper-item>
</swiper>