app.json
- 小程序根目录下的
app.json文件用来对微信小程序进行全局配置。 ```json //app.json 文件
{
//页面路径列表 => 项目中有几个页面,这里就要写几个页面
//=> 新增/减少页面,都需要对 pages 数组进行修改
“pages”: [
“pages/index/index”, //第一项代表小程序的初始页面(首页)
“pages/logs/logs”,
“pages/history/history”
],
// 用于设置小程序全局的状态栏、导航条、标题、窗口背景色。 “window”: { “backgroundTextStyle”: “light”, // 下拉 loading 的样式 “navigationBarBackgroundColor”: “#64b2f9”, // 导航栏背景颜色
"navigationBarTitleText": "weapp", // 导航栏标题文字内容"navigationBarTextStyle": "white" //导航栏标题颜色
},
//用于设置底部或顶部有 tab 栏可以切换页面,以及对 tab 栏的配置
“tabBar”: { “color”: “#F8F8FF”, //tab 上的文字默认颜色
"position": "bottom", //tabBar 的位置是顶部还是底部 => 顶部没法设置图标,只有底部才可以"selectedColor": "#F8F8FF", //tab 上的文字选中时的颜色"borderStyle": "black", // tabbar 上边框的颜色"backgroundColor": "#64b2f9", //tab 的背景色// list 接受一个数组,只能配置最少 2 个、最多 5 个 tab"list": [{"pagePath": "pages/index/index",//点击后转到的 tab 路径=>必须在pages也要定义这个路径"text": "翻译",//tab 上按钮文字"iconPath": "pages/index/2.png",//tab没有选中时候的图片路径"selectedIconPath": "pages/index/1.png" //tab选中时的图片显示},{"pagePath": "pages/history/history","text": "生词本","iconPath": "pages/index/4.png","selectedIconPath": "pages/index/5.png"}]
},
“usingComponents”: { “iconfont”: “/iconfont/iconfont” },
“style”: “v2”, “sitemapLocation”: “sitemap.json” } ```
app.wxss
- 控制全局的样式
