uniapp 放大中间图标

方法1:使用css

复制代码
/*样式直接复制到项目的App.vue即可*/

.uni-tabbar {
/*.uni-tabbar__item:nth-last-child(3) 修改倒数第三个 也就是中间的图标 我这边底部栏是五个*/
		.uni-tabbar__item:nth-last-child(3) {
			.uni-tabbar__bd {
			/*.uni-tabbar__icon 去掉原图标大小,强制为自适应宽高*/
				.uni-tabbar__icon {
					width: auto !important;
					height: auto !important;
				}
				/*图标大小 !important 强制覆盖*/
				img {
					height: 70rpx !important;
					width: 70rpx !important;
				}
			}
		}
	}

方法2:配置midButton(和tabbar中list同级)

复制代码
"midButton": {
            "width": "48px",
            "height": "48px",
            "text": "",
            "iconPath": "static/tabbar/home-s.png",
            "iconWidth": "48px",
        }

 API放在一个app.vue的页面内就好了。url里填写你要跳转的路径。

uni.onTabBarMidButtonTap(()=>{

                       uni.navigateTo({

                        url: '/pages/card/card'

                       });

                    })

官网资料:uni-app官网

相关推荐
TE-茶叶蛋31 分钟前
Vuerouter 的底层实现原理
开发语言·javascript·ecmascript
发呆小天才yy1 小时前
uniapp 微信小程序使用图表
前端·微信小程序·uni-app·echarts
@PHARAOH3 小时前
HOW - 在 Mac 上的 Chrome 浏览器中调试 Windows 场景下的前端页面
前端·chrome·macos
源码云商5 小时前
Spring Boot + Vue 实现在线视频教育平台
vue.js·spring boot·后端
月月大王5 小时前
easyexcel导出动态写入标题和数据
java·服务器·前端
JC_You_Know6 小时前
多语言网站的 UX 陷阱与国际化实践陷阱清单
前端·ux
Python智慧行囊6 小时前
前端三大件---CSS
前端·css
Jinuss6 小时前
源码分析之Leaflet中Marker
前端·leaflet
成都渲染101云渲染66666 小时前
blender云渲染指南2025版
前端·javascript·网络·blender·maya
聆听+自律6 小时前
css实现渐变色圆角边框,背景色自定义
前端·javascript·css