美文网首页
uni-app横向滚动

uni-app横向滚动

作者: LemonTree7 | 来源:发表于2021-05-18 13:59 被阅读0次
<template>
    <view>
        <scroll-view class="scroll-view_H" scroll-x="true" @scroll="handleScroll" scroll-left="120">
        <view id="demo1" class="scroll-view-item_H uni-bg-red">A</view>
        <view id="demo2" class="scroll-view-item_H uni-bg-green">B</view>
        <view id="demo3" class="scroll-view-item_H uni-bg-blue">C</view>
    </scroll-view>
    </view>
</template>

<script>
    export default {
            // 横向滚动
        handleScroll(e) {
        console.log(e);
        }
        }
</script>

<style lang="scss" scoped>
    .scroll-view_H{
        white-space: nowrap;
        width: 100%;
        .scroll-view-item_H{
            display: inline-block;
            width: 100%;
            height: 150px;
            line-height: 150px;
            text-align: center;
            font-size: 18px;
            background: yellow;
        }
    }
</style>

相关文章

网友评论

      本文标题:uni-app横向滚动

      本文链接:https://www.haomeiwen.com/subject/gyjpjltx.html