uni-app学习02 底部选项卡

项目搭建

在这里插入图片描述

images

可以从阿里巴巴矢量图标库中下载所需图标https://www.iconfont.cn/help/detail?helptype=about
下载后将图片放入images文件夹中。

在pages.json文件中配置图标:


```css
```css
	"tabBar": {
		"list": [
			{
				"pagePath": "pages/home/home",
				"text": "首页",
				// iconPath为未被选择的普通状态,selectedIconPath为被选择的高亮状态
				"iconPath": "static/images/tabBar/shouye5.png",
				"selectedIconPath": "static/images/tabBar/shouye6.png"
				
			},
			{
				"pagePath": "pages/chat/chat",
				"text": "消息",
				"iconPath": "static/images/tabBar/liaotianduihua-xianxing.png",
				"selectedIconPath": "static/images/tabBar/liaotianduihua.png"
			},
			{
				"pagePath": "pages/shoppingCart/shoppingCart",
				"text": "购物车",
				"iconPath": "static/images/tabBar/gouwuche.png",
				"selectedIconPath": "static/images/tabBar/gouwuchefill.png"
			},
			{
				"pagePath": "pages/aboutMe/aboutMe",
				"text": "个人中心",
				"iconPath": "static/images/tabBar/wo_weijihuo.png",
				"selectedIconPath": "static/images/tabBar/wo_jihuo.png"
			}
		]
	}

实现效果,下方出现图标
效果图
点击切换界面,首页图标切换为未激活,选中的图标切换为激活

效果2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值