一、通常情况下都是在app.vue中全局隐藏滚动条
app.vue中
<style lang="scss">
// --- 隐藏scroll-view滚动条
::-webkit-scrollbar{
display: none;
}
uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
display: none
}
<style>
二、在某个特定的页面显示滚动条
其他页面
<style lang="scss" scoped>
::v-deep ::-webkit-scrollbar {
/* 滚动条整体样式 */
display: block !important;
width: 7rpx;
}
::v-deep ::-webkit-scrollbar-thumb {
/* 滚动条里面小方块 */
border-radius: 5rpx !important;
box-shadow: inset 0 0 1rpx rgba(0, 0, 0, 0.2) !important;
background-color: #CCCCCC !important;
}
</style>