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

相关推荐
像我这样帅的人丶你还1 小时前
使用 Next.js + Prisma + MySQL 开发全栈项目
前端
FPGA小迷弟1 小时前
FPGA 时序约束基础:从时钟定义到输入输出延迟的完整设置
前端·学习·fpga开发·verilog·fpga
Kel1 小时前
深入剖析 openai-node 源码:一个工业级 TypeScript SDK 的架构之美
javascript·人工智能·架构
毛骗导演2 小时前
@tencent-weixin/openclaw-weixin 插件深度解析(四):API 协议与数据流设计
前端·架构
毛骗导演2 小时前
@tencent-weixin/openclaw-weixin 插件深度解析(二):消息处理系统架构
前端·架构
IT_陈寒2 小时前
深入理解JavaScript:核心原理与最佳实践
前端·人工智能·后端
MrGud2 小时前
Cesium中的坐标系及其转换
前端·cesium
小付学代码2 小时前
香港地图可编辑版
前端
兆子龙2 小时前
TypeScript高级类型编程:从入门到精通
前端·后端
SuperEugene2 小时前
Vue3 模板语法规范实战:v-if/v-for 不混用 + 表达式精简,避坑指南|Vue 组件与模板规范篇
开发语言·前端·javascript·vue.js·前端框架