一.问题:scroll-view可以滚动,但是不显示滚动条
<scroll-view style="height: 500rpx;padding-bottom: 15rpx;" show-scrollbar="true" scroll-y="true" >
</scroll-view>
二。原因:被::-webkit-scrollbar这个样式影响
三.解决
<style lang="scss" scoped>
::v-deep ::-webkit-scrollbar {
/*滚动条整体样式*/
width: 4px !important;
height: 1px !important;
overflow: auto !important;
background: #ccc !important;
-webkit-appearance: auto !important;
display: block;
}
::v-deep ::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px !important;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
background: #7b7979 !important;
}
::v-deep ::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
// border-radius: 10px !important;
background: #FFFFFF !important;
}
</style>