开启enable-flex,flex-direction:'row',justitfy-content: 'space-around'时,横向滚动条展示不全,前几项出不来,改成flex-start就正常了,有什么解决办法吗
flex-start 前几项就能正常出来也能正常滑动了
<scroll-view
class="x-tabs-content"
scroll-x
enable-flex
using-sticky
enable-passive
show-scrollbar="{{false}}"
enhanced
>
<block wx:for="{{items}}" wx:key="{{item.menuId}}_menu_{{index}}">
<view
data-id="{{item.id}}"
data-index="{{index}}"
data-name="{{item.name}}"
bindtap="onTap"
class="x-tabs-content-item"
style="{{ tabIndex === index ? tabItemActiveStyle : tabItemStyle }}"
>
<view class="name">{{item.name}}</view>
</view>
</block>
</scroll-view>
.x-tabs {
position: relative;
min-height: 60rpx;
&-content {
&.ceiling {
position: fixed;
// top: 100rpx;
}
height: 60rpx;
display: flex;
// align-items: center;
justify-content: space-around;
flex-direction: row;
flex-wrap: nowrap;
white-space: nowrap;
box-sizing: content-box;
z-index: 99;
overflow: scroll;
width: 100%;
}
css的样式就这样的效果,用横向滚动就别想着居中了,除非自己计算实现默认显示最左边