29-新闻小案例1

65 阅读1分钟

新建一个项目,并且新建一个页面user

接下来在pages.json中配置项目的tabbar的图标,导航栏的背景色和文字颜色

{
	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
		{
			"path": "pages/index/index",
			"style": {
				"navigationBarTitleText": "青年帮新闻"
			}
		}
	    ,{
            "path" : "pages/user/user",
            "style" :                                                                                    
            {
                "navigationBarTitleText": "个人中心",
                "enablePullDownRefresh": false
            }
            
        }
    ],
	"globalStyle": {
		"navigationBarTextStyle": "white",
		"navigationBarTitleText": "青年帮新闻",
		"navigationBarBackgroundColor": "#31c27c",
		"backgroundColor": "#F8F8F8"
	},
	"uniIdRouter": {},
  "tabBar": {
    "color": "#666",
    "selectedColor": "#31c27c",
    "list": [
      {
        "text": "首页",
        "pagePath": "pages/index/index",
        "iconPath": "static/images/home.png",
        "selectedIconPath": "static/images/home-h.png"
      },{
        "text": "个人",
        "pagePath": "pages/user/user",
        "iconPath": "static/images/user.png",
        "selectedIconPath": "static/images/user-h.png"
      }
    ]
  }
}

image.png