solve
The scroll-view of uni-app will be rendered with an additional class name .uni-scroll-view
, which requires style penetration:
// scss
.scroll-view上的类名 {
/deep/ .uni-scroll-view {
&::-webkit-scrollbar {
width: 8rpx;
// height: 13px;
border-radius: 22rpx;
}
&::-webkit-scrollbar-thumb {
width: 8rpx;
border-radius: 22rpx;
background: #8095BF;
}
&::-webkit-scrollbar-track-piece {
margin-top: 26rpx;
background: rgba(33, 69, 143, 0.1);
border-radius: 22rpx;
}
}
}
The official document mentions a sentence that can be -webkit-scrollbar
modified, Wangshan ran to death, and it took me a long time to find the problem! Damn!