css - CSS 固定底部tabbar遮挡页面内容如何解决?

 

问题描述:

自定义的tabbar组件
css

.k-tabbar {
  display: flex;
  justify-content: space-around;
  font-size: 12px;
  z-index: 999;
  padding-top: 10px;
  left: 0;
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: $blue;


  &-red {
    background: $red;
  }



  .tabbar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 50px;
    color: #bbb;

    &.active {
      color: #fff;
    }
  }

}

html

 <view class="k-tabbar" :class="curThemeType == '蓝色海洋' ? '' : 'k-tabbar-red'">
    <template v-for="item in tabData">
      <view :key="item.name" class="tabbar-content" :class="item.name == tabName ? 'active' : ''"
        @click="handleClick(item.path)">
        <u-icon :name="item.icon" :color="item.name == tabName ? '#fff' : '#bbb'"></u-icon>
        <view>{{ item.title }}</view>
      </view>
    </template>
  </view>

tabbar 组件引入到 其他页面的时候 总是遮挡底部内容

image.png
这种问题怎么解决 能让页面内容高度auto 并且不被遮挡住


 

第 1 个答案:

.page-content {
  padding-bottom: 50px;
}
或者

.page-content {
  margin-bottom: 50px;
}

在执行yarn upgrade caniuse-lite browserslist命令时,出现了如下错误,请问应该如何 ...