微信小程序为了实现scroll-view配合swiper实现tab栏切换 动态的渲染scroll-view 滑动swiper scroll-view滚动到相对应的地方,网上找了很多资料,但都不尽人意,小白试了进一天,终于找到答案,闲话不多说,直接上代码。
代码:
##wxss
.top_bottomView {
display: flex;
border-bottom: 4rpx solid #f5f5f5;
}
.scroll-x {
height: 78rpx;
width: 88%;
white-space: nowrap;
box-sizing: border-box;
overflow: hidden;
}
/* 隐藏scrollbar */
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.view-inline{
width: 17.2%;
height: 100%;
display: inline-block;
}
.view-item {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
font-size: 32rpx;
opacity: 0.6;
}
.item-active {
opacity: 1;
font-size: 36rpx;
}
.top_rightView {
width: 12%;
height: 78rpx