uni-app开发攻略 底部导航栏

uni-app开发攻略 底部导航栏

{
	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
		{
			"path": "pages/index/index",
			"style": {
				"navigationBarTitleText": "首页",
				"navigationBarBackgroundColor": "#eee"
			}
		},
		{
			"path": "pages/find/find",
			"style": {
				"navigationBarTitleText": "发现",
				"navigationBarBackgroundColor": "#eee"
			}
		},
		{
			"path": "pages/nav/nav",
			"style": {
				"navigationBarTitleText": "导航",
				"navigationBarBackgroundColor": "#eee"
			}
		},
		{
			"path": "pages/person/person",
			"style": {
				"navigationBarTitleText": "我的",
				"navigationBarBackgroundColor": "#eee"
			}
		}
	],
	"globalStyle": {
		"navigationBarTextStyle": "black", //导航
		"navigationBarTitleText": "uni-app", //导航栏标题文本
		"navigationBarBackgroundColor": "#4CD964", //导航背景色
		"backgroundColor": "#F8F8F8"
	},
	"tabBar": {
		"color": "#cdcdcd",
		"selectedColor": "#39cffc",
		"borderStyle": "black",
		"backgroundColor": "#ffffff",
		"list": [{
				"pagePath": "pages/index/index",
				"iconPath": "static/index.png",
				"selectedIconPath": "static/index1.png",
				"text": "首页"
			}, {
				"pagePath": "pages/find/find",
				"iconPath": "static/find.png",
				"selectedIconPath": "static/find1.png",
				"text": "发现"
			},
			{
				"pagePath": "pages/nav/nav",
				"iconPath": "static/nav.png",
				"selectedIconPath": "static/nav1.png",
				"text": "导航"
			}, {
				"pagePath": "pages/person/person",
				"iconPath": "static/person.png",
				"selectedIconPath": "static/person1.png",
				"text": "我的"
			}
		]
	},

	"condition": { //模式配置,仅开发期间生效
		"current": 1, //当前激活的模式(list 的索引项)
		"list": [{
				"name": "首页", //模式名称
				"path": "pages/index/index", //启动页面,必选
				"query": "" //启动参数,在页面的onLoad函数里面得到。uid=100&t=1535987051
			},
			{
				"name": "发现", //模式名称
				"path": "pages/find/find", //启动页面,必选
				"query": "" //启动参数,在页面的onLoad函数里面得到。
			},
			{
				"name": "导航", //模式名称
				"path": "pages/nav/nav", //启动页面,必选
				"query": "" //启动参数,在页面的onLoad函数里面得到。uid=100&t=1535987051
			},
			{
				"name": "我的", //模式名称
				"path": "pages/person/person", //启动页面,必选
				"query": "" //启动参数,在页面的onLoad函数里面得到。
			}
		]
	}
}

你可能感兴趣的:(uni-app开发攻略 底部导航栏)