wechat-miniprogram / miniprogram-component-plus

MIT License
268 stars 79 forks source link

tabs 高度不能设置 #15

Open gtyang opened 3 years ago

gtyang commented 3 years ago

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;
}
ratelgogo commented 3 years ago
.weui-tabs-swiper {
    height: 100vh;
}
.tab-content {
    height: calc(100vh - 200rpx) !important;
    overflow-y: auto !important;
}
ratelgogo commented 3 years ago

https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/extended/component-plus/tabs.html 注意事项里有说明