uniapp scroll-x布局

17 阅读1分钟
// 模版
<scroll-view class="scroll-x--wrap" scroll-x="true">
    <view class="scroll-x-box">
        <view class="scroll-x-item" v-for="(tab, index) in tabList" :key="index">
            {{ tab.name }}
        </view>
    </view>
</scroll-view>

// 样式
.scroll-x--wrap {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.scroll-x-box {
    display: flex;
    align-items: center;
    height: 72rpx;
}