如何写一个uniapp自定义tarbar导航栏?

第一 图片 第二路 创建页面 设置tarbar

javascript 复制代码
{
	"pages": [

		{
			"path": "pages/login/login",
			"style": {
				"navigationBarTitleText": "",
				"navigationBarBackgroundColor": "#00C8AA"
			}
		},
		{
			"path": "pages/index/index",
			"style": {
				"navigationBarTitleText": "医院名称",
				"navigationBarBackgroundColor": "#00C8AA",
				"navigationBarTextStyle": "white"
			}
		},
		{
			"path": "pages/information/information",
			"style": {
				"navigationBarTitleText": "医院信息",
				"navigationBarBackgroundColor": "#00C8AA",
				"navigationBarTextStyle": "white"
			}
		},
		{
			"path": "pages/expert/expert",
			"style": {
				"navigationBarTitleText": "专家榜",
				"navigationBarBackgroundColor": "#00C8AA",
				"navigationBarTextStyle": "white"
			}
		}

	],
	"tabBar": {
		"backgroundColor": "#ffffff",
		"color": "rgba(128, 128, 128, 1)",
		"selectedColor": "#7CECE4",
		"list": [{
				"text": "首页",
				"pagePath": "pages/index/index",
				"iconPath": "static/w.png",
				"selectedIconPath": "static/homes.png"
			},
			{
				"text": "医院信息",
				"pagePath": "pages/information/information",
				"iconPath": "static/info.png",
				"selectedIconPath": "static/j.png"
			},
			{
				"text": "专家榜",
				"pagePath": "pages/expert/expert",
				"iconPath": "static/doctor.png",
				"selectedIconPath": "static/ooo.png"
			}

		]
	},


	"easycom": {
		"autoscan": true,
		"custom": {
			"^uv-(.*)": "@climblee/uv-ui/components/uv-$1/uv-$1.vue"
		}
	},
	"globalStyle": {
		"navigationBarTextStyle": "black",
		"navigationBarTitleText": "uni-app",
		"navigationBarBackgroundColor": "#F8F8F8",
		"backgroundColor": "#F8F8F8",
		"app-plus": {
			"background": "#efeff4",
			"titleNView": false
		}
	},
	"condition": { //模式配置,仅开发期间生效
		"current": 0, //当前激活的模式(list 的索引项)
		"list": [{
			"name": "", //模式名称
			"path": "pages/home/home", //启动页面,必选
			"query": "" //启动参数,在页面的onLoad函数里面得到
		}]
	}
}

其二

在static文件夹放图片

其三 设置pages.json 创建页面

相关推荐
冴羽19 分钟前
今日苹果 App Store 前端源码泄露,赶紧 fork 一份看看
前端·javascript·typescript
蒜香拿铁22 分钟前
Angular【router路由】
前端·javascript·angular.js
时间的情敌28 分钟前
Vite 大型项目优化方案
vue.js
brzhang1 小时前
读懂 MiniMax Agent 的设计逻辑,然后我复刻了一个MiniMax Agent
前端·后端·架构
西洼工作室1 小时前
高效管理搜索历史:Vue持久化实践
前端·javascript·vue.js
广州华水科技1 小时前
北斗形变监测传感器在水库安全中的应用及技术优势分析
前端
开发者如是说1 小时前
Compose 开发桌面程序的一些问题
前端·架构
晟盾科技2 小时前
报表类系统后端API设计思路
开发语言·windows·php
旺代2 小时前
Token 存储与安全防护
前端
洋不写bug2 小时前
html实现简历信息填写界面
前端·html