unicloud云开发进阶18-项目2全局配置及导航切换

83 阅读1分钟

创建页面

style加scoped表示是局部组件 创建一个self页面,这样加上首页就有两个页面了

image.png

配置底部导航栏、图标、title

在pages.json文件中

{
	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
		{
			"path": "pages/index/index",
			"style": {
				
			}
		}
	    ,{
            "path" : "pages/self/self",
            "style" :                                                                                    
            {
                "navigationBarTitleText": "个人中心",
                "enablePullDownRefresh": false
            }
            
        }
    ],
	"globalStyle": {
		"navigationBarTextStyle": "white",
		"navigationBarTitleText": "我的圈子",
		"navigationBarBackgroundColor": "#0199FE",
		"backgroundColor": "#F8F8F8"
	},
  "tabBar": {
    "color": "#888",
    "selectedColor": "#0199FE",
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "圈子",
        "iconPath": "static/images/quanzi.png",
        "selectedIconPath": "static/images/quanzi-fill.png"
      },{
        "pagePath": "pages/self/self",
        "text": "我的",
        "iconPath": "static/images/user.png",
        "selectedIconPath": "static/images/user-fill.png"
      }
    ]
  },
	"uniIdRouter": {}
}

image.png

image.png