uni-app的vue页面,app端scroll-view的滚动条设置,可通过css的-webkit-scrollbar自定义,包括隐藏滚动条。(app-nvue无此css)
在pages.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中:
<style>
/*每个页面公共css */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>
相关文档
scroll-view组件
app-plus配置
版权声明:本文为weixin_44781626原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。