uniapp中隐藏scroll-view的滚动条

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的滚动条)