- 要给父级.article设置height:100%,页面被内容撑开,才能显示数据;
- 给添加scroll-y可上下滑动;
- height: calc(100% - 100rpx);
- css实现吸顶:position: sticky;top: 0upx;
<template>
<view class="article">
<view class="uni-tab-bar">
<scroll-view id="tab-bar" class="" scroll-x :scroll-left="scrollLeft">
<view v-for="(tab,index) in tabBars" :key="tab.id" class="swiper-tab-list" :class="tabIndex==index ? 'active' : ''"
:id="tab.id" :data-current="index" @click="tapTab">{
{tab.name}}</view>
</scroll-view>
<swiper :current="tabIndex" class="swiper-box " :duration="300"