1.vue页面中可以在html里面加入css属性
mounted() {
document.querySelector("html").classList.add("big");
},
destroyed() {
document.querySelector("html").classList.remove("big");
},
<style lang="scss">
.big {
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 0; /*高宽分别对应横竖滚动条的尺寸*/
height: 0;
}
}
</style>
2.直接使用属性 display: none;
.div{
width: 100%;
height: 100%;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
}
滚动条样式设置