uniapp scorll-view modification scroll bar style invalid

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-scrollbarmodified, Wangshan ran to death, and it took me a long time to find the problem! Damn!

Guess you like

Origin blog.csdn.net/weixin_54858833/article/details/128331594