miniprogram-component-plus icon indicating copy to clipboard operation
miniprogram-component-plus copied to clipboard

tabs 高度不能设置

Open gtyang opened this issue 4 years ago • 2 comments

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;
}

gtyang avatar Nov 08 '20 11:11 gtyang

.weui-tabs-swiper {
    height: 100vh;
}
.tab-content {
    height: calc(100vh - 200rpx) !important;
    overflow-y: auto !important;
}

ratelgogo avatar Oct 18 '21 08:10 ratelgogo

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

ratelgogo avatar Oct 18 '21 08:10 ratelgogo