取消uniapp的scroll-view滚动条

 重点代码部分:

/deep/ ::-webkit-scrollbar {
	  display: block;
	  width: 4px !important;
	  height: 1px !important;
	  overflow: auto !important;
	  background: transparent !important;
	  -webkit-appearance: auto !important;
	}

 有滚动条代码:

<template>
	<view class="home">
		<scroll-view scroll-x  class="navscroll">
			<view class="item" v-for="item in 10">国内</view>
		</scroll-view>
	</view>
</template>

<script setup>

</script>

<style lang="scss" scoped>
.navscroll{
	height: 100rpx;
	// background-color: #fa7f8fa;
	background-color: #40a1fa;
	white-space: nowrap;
	.item{
		font-size: 40rpx;
		display: inline-block;
		line-height: 100rpx;
		padding:  0 30rpx;
	}
}
</style>

隐藏滚动条代码:

<template>
	<view class="home">
		<scroll-view scroll-x  class="navscroll">
			<view class="item" v-for="item in 10">国内</view>
		</scroll-view>
	</view>
</template>

<script setup>

</script>

<style lang="scss" scoped>
.navscroll{
	height: 100rpx;
	// background-color: #fa7f8fa;
	background-color: #40a1fa;
	white-space: nowrap;
	/deep/ ::-webkit-scrollbar {
	  display: block;
	  width: 4px !important;
	  height: 1px !important;
	  overflow: auto !important;
	  background: transparent !important;
	  -webkit-appearance: auto !important;
	}
	.item{
		font-size: 40rpx;
		display: inline-block;
		line-height: 100rpx;
		padding:  0 30rpx;
	}
}
</style>

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-26 09:34:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-26 09:34:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-26 09:34:01       82 阅读
  4. Python语言-面向对象

    2024-03-26 09:34:01       91 阅读

热门阅读

  1. 二进制王国【蓝桥杯算法双周赛】

    2024-03-26 09:34:01       42 阅读
  2. 鲁棒的设计

    2024-03-26 09:34:01       39 阅读
  3. ip 协议

    ip 协议

    2024-03-26 09:34:01      29 阅读
  4. ubuntu22 安装docker26

    2024-03-26 09:34:01       37 阅读
  5. 笔记-《A Survey of Large Language Models》- 4 预训练

    2024-03-26 09:34:01       41 阅读
  6. LeetCode 面试经典150题 125.验证回文串

    2024-03-26 09:34:01       34 阅读
  7. LeetCode Hot100-哈希-两数之和

    2024-03-26 09:34:01       36 阅读
  8. 前端埋点解决方案

    2024-03-26 09:34:01       41 阅读
  9. Redis分布式锁实现

    2024-03-26 09:34:01       48 阅读