miniprogram-component-plus
miniprogram-component-plus copied to clipboard
tabs 高度不能设置
tabs-content 里内容高度调整后,容器的高度没有跟着变化
<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}}" > <view style="height: 300px;"> {{item.title}} </view></view>
</block>
</mp-tabs>
<view> ---- footer ---- </view>
这是移除了样式表里的高度设置
.tab-content {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
padding: 40rpx;
}
.weui-tabs-swiper {
height: 100vh;
}
.tab-content {
height: calc(100vh - 200rpx) !important;
overflow-y: auto !important;
}
https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/extended/component-plus/tabs.html 注意事项里有说明