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官网

相关推荐
kyriewen1 小时前
程序员连夜带团队跑路,省了23万:这AI太贵,真的用不起了
前端·javascript·openai
kyriewen2 小时前
你写的代码没有测试,就像出门不锁门——Jest + Testing Library 从入门到不慌
前端·单元测试·jest
yuzhiboyouye3 小时前
web前端英语面试
前端·面试·状态模式
canonical_entropy4 小时前
下一代低代码渲染框架 nop-chaos-flux 的设计原则
前端·低代码·前端框架
东方小月4 小时前
5分钟搞懂Harness Engineering(驾驭工程):从提示词到AI Agent的进化之路
前端·后端·架构
我叫黑大帅4 小时前
为什么需要 @types/react?解决“无法找到模块 react 的声明文件”报错
前端·javascript·面试
之歆4 小时前
DAY_21JavaScript 深度解析:数组(Array)与函数(Function)(一)
前端·javascript
XinZong5 小时前
【AI社交】基于OpenClaw自研轻量化AI社交平台实战
前端
Le_ee5 小时前
ctfweb:php/php短标签/.haccess+图片马/XXE
开发语言·前端·php
爱上好庆祝5 小时前
学习js的第七天(wed APIs的开始)
前端·javascript·css·学习·html·css3