美文网首页
uniapp中隐藏scroll-view的滚动条

uniapp中隐藏scroll-view的滚动条

作者: 冰点雨 | 来源:发表于2022-08-15 11:49 被阅读0次

page.json增加配置项

"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
        {
            "path": "pages/index/index",
            "style": {
                "navigationBarTitleText": "index",
                "app-plus": {
                    "scrollIndicator": "none"//隐藏该页面滚动条
                }
            }
        }
    ],
    "globalStyle": {
        "navigationBarTextStyle": "black",
        "navigationBarTitleText": "uni-app",
        "navigationBarBackgroundColor": "#F8F8F8",
        "backgroundColor": "#F8F8F8",
        "app-plus": {
            "scrollIndicator": "none"//隐藏所有页面滚动条
        }
    }

在App.vue页面的style中:

::-webkit-scrollbar {
        display: none;
        width: 0 !important;
        height: 0 !important;
        -webkit-appearance: none;
        background: transparent;
    }

相关文章

网友评论

      本文标题:uniapp中隐藏scroll-view的滚动条

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