视频展示
动图展示
Demo代码
index.wxml
<mp-tabs tabs="{
{tabs}}" activeTab="{
{activeTab}}" swiperClass="weui-tabs-swiper" bindtabclick="onTabCLick" bindchange="onChange" activeClass="tab-bar-title__selected">
<block wx:for="{
{tabs}}" wx:key="title">
<view class="tab-content" slot="tab-content-{
{index}}">
<image src="{
{images[index]}}">image>
view>
block>
mp-tabs>
index.wxss
page {
background-color: #FFFFFF;
height: 100%;
}
.weui-tabs-bar__wrp {
border-bottom: 1px solid #eee;
margin-top: 10px;
}
.weui-tabs-swiper {
width: 100%;
height: 100%;
}
.tab-content {
height: 100px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-top: 100px;
box-sizing: border-box;
padding: 40rpx;
}
.weui-tabs-bar__title {
margin: 0px 10px;
}
.tab-bar-title__selected {
font-size: 20px;
font-weight: bold;
}
index.json
{
"usingComponents": {
"mp-tabs": "../../components/tabs/index"
}
}
index.js
Page({
data: {
tabs: [],
activeTab: 0,
images: ["https://wx1.sinaimg.cn/large/7139bff5ly1fjasmh731ig20dw0b04bx.gif",
"https://wx1.sinaimg.cn/l