单独指定页面隐藏(找到对应的scroll-view)
<style>
/* 全局隐藏滚动条样式 */
::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
background: transparent;
}
/* 确保scroll-view组件也隐藏滚动条 */
scroll-view::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
background: transparent;
}
/* 为页面添加隐藏滚动条样式 */
.comment-list::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
background: transparent;
}
/* 其他样式保持不变 */
// ... existing code ...
</style>
全局隐藏(在App.vue的css中插入下面代码即可):
<style>
/* 全局隐藏滚动条 */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>