2***@qq.com
2***@qq.com
  • 发布:2024-02-09 10:33
  • 更新:2024-02-19 11:40
  • 阅读:166

大佬们为什么我的微信小程序不显示滑块呀 代码查不到问题呀

分类:HBuilderX

我想要的效果是和图片里那样 但现在不显示滑块

<template>  
    <view class="shouyeContainer">  
        <!--头部-->  
        <view class="header">  
            <image class='logo' src="../../static/icon/首页图标.jpg" mode=""></image>  
            <view class="search">  
                <text class='iconfont icon-sousuo'></text>  
                <input type="text" value="" placeholder="搜索..." placeholder-class='placeholder'/>  

                </view>  
                <button type="default">考研上岸</button>  
            </view>  
        </view>  
        <!--滑块-->  
        <scroll-view class="navcroll" scroll-x="true" >  
            <view class="navItem">推荐</view>  
            <view class="navItem">推荐</view>  
            <view class="navItem">推荐</view>  
            <view class="navItem">推荐</view>  
            <view class="navItem">推荐</view>  
        </scroll-view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  

            }  
        },  
        methods: {  

        }  
    }  
</script>  

<style lang='stylus'>  
    .shouyeContainer  
        .header  
            display flex  
            padding 10rpx 5rpx  
            .logo  
                width 140rpx  
                height 40rpx  
                margin: 10rpx  
            .search  
                width 420rpx  
                height 60rpx  
                background: #F0FFFF  
                position: relative  
                input  
                    width: 360rpx  
                    height: 60rpx  
                    margin-left: 60rpx  
                    .placeholder  
                        font-size: 26rpx  
                .iconfont  
                    position: absolute  
                    font-size: 40rpx  
                    left: 10rpx  
                    top: 10rpx  
            button  
                width: 144rpx  
                height: 60rpx  
                line-height: 60rpx  
                text-align center  
                font-size 26rpx  
                padding: 0 4rpx  
        .navcroll  
            display flex  
            white-space nowrap  
            .navItem  
                display: inline-block  
</style>  
2024-02-09 10:33 负责人:无 分享
已邀请:
JXWang

JXWang

是推荐推荐那里想要滑动嘛,没有滑动的原因是内容太少,内存宽度没有超过父组件scroll-view的宽度,所有不能滑动,多加点内容或者写个内边距让内容宽度超出scroll-view宽度就可以了

要回复问题请先登录注册