uniapp中底部tabbar设置

编程入门 行业动态 更新时间:2024-10-24 20:17:07

<a href=https://www.elefans.com/category/jswz/34/1769663.html style=uniapp中底部tabbar设置"/>

uniapp中底部tabbar设置

一、目的:设置底部tabbar

二、设置tabbar

  1. 在page.json文件下进行配置

  1. tabbar与pages、globalStyle等同级书写

  1. color:默认文字颜色

selectedColor:选中的文字颜色

  1. list是数组,里面的tabbar至少2个至多5个

  1. pagepath:页面的路径

iconPath:默认图标路径

selectedIconPath选中的图标路径

text文字的内容

三、代码展示:

代码:

"tabBar": {"color": "#000000","selectedColor": "D81E06","list": [{"pagePath": "pages/index/index","iconPath": "static/tabbar/home.png","selectedIconPath": "static/tabbar/home-active.png","text": "消息"},{"pagePath": "pages/list/list","iconPath": "static/tabbar/cate.png","selectedIconPath": "static/tabbar/cate-active.png","text": "列表"},{"pagePath": "pages/shopCart/shopCart","iconPath": "static/tabbar/cart.png","selectedIconPath": "static/tabbar/cart-active.png","text": "购物车"},{"pagePath": "pages/my/my","iconPath": "static/tabbar/my.png","selectedIconPath": "static/tabbar/my-active.png","text": "我的"}]
},

四、结果展示:

五、具体配置项分享:

见官网展示:

.html#tabbar

更多推荐

uniapp中底部tabbar设置

本文发布于:2024-03-08 20:31:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1722231.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:uniapp   tabbar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!