如何写一个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 创建页面

相关推荐
mCell20 小时前
GSAP ScrollTrigger 详解
前端·javascript·动效
gnip20 小时前
Node.js 子进程:child_process
前端·javascript
excel1 天前
为什么在 Three.js 中平面能产生“起伏效果”?
前端
excel1 天前
Node.js 断言与测试框架示例对比
前端
天蓝色的鱼鱼1 天前
前端开发者的组件设计之痛:为什么我的组件总是难以维护?
前端·react.js
codingandsleeping1 天前
使用orval自动拉取swagger文档并生成ts接口
前端·javascript
石金龙1 天前
[译] Composition in CSS
前端·css
白水清风1 天前
微前端学习记录(qiankun、wujie、micro-app)
前端·javascript·前端工程化
Ticnix1 天前
函数封装实现Echarts多表渲染/叠加渲染
前端·echarts
用户22152044278001 天前
new、原型和原型链浅析
前端·javascript