在uniapp项目中经常会用到swiper。。一般用其是用来切换图片之类的,但是在我司项目中,更多的还是用来做内容分类的切换。。因此,有时候分类下的内容不是固定高度的。。需要自适应内容的高度。
1.首先是高度固定,但是内容可以滚动的时候的运用
1.1效果图
template部分
<!-- 选项卡 -->
<view style="height: 90rpx;" >
<scroll-view scroll-x class="bg-white nav" style="position: fixed;top: 0;" scroll-with-animation :scroll-left="scrollLeft">
<view class="cu-item" v-for="(item,index) in list" :key="index" @tap="changeCurrent" :data-id="index">
<text :class="[currentTab==index?'avciveItem':'']">{
{i