小程序框架提供了自己的视图层描述语言WXML和WXSS以及JavaScript,并在视图层与逻辑层间提供了数据传输和事件系门统,让开发者能够专注于数据与逻辑
1.项目目录介绍
2.文档查找
https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html
3.配置介绍
个小程序应用程序会包括最基本的两种配置文件。一种是全局的app.json和页面自己的page.json
1.全局配置app.json
配置中包名的先后顺序,会改变页面的显示顺序。
"window":{
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": "尤如旭",
"navigationBarTextStyle":"white",
"enablePullDownRefresh":true
backgroundTextStyle:下拉 loading 的样式,仅支持 dark / light
navigationBarBackgroundColor:导航栏背景颜色
navigationBarTitleText:导航栏标题文字内容
navigationBarTextStyle:导航栏标题颜色,仅支持 black / white
enablePullDownRefresh:是否开启全局的下拉刷新。
tabBar
如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。
"tabBar": {
"color": "#000",
"selectedColor": "#ef1919",
"backgroundColor": "#777777",
"borderStyle": "black",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "icons/home.png",
"selectedIconPath": "icons/homered.png"
},
{
"pagePath": "pages/logs/logs",
"text": "购物车",
"iconPath": "icons/shopping.png",
"selectedIconPath": "icons/shoppingred.png"
}
]
},
注意:至少两个数组
2.页面配置page.json
app.json 中的部分配置,也支持对单个页面进行配置,可以在页面对应的 .json 文件来对本页面的表现进行配置。页面中配置项在当前页面会覆盖 app.json 中相同的配置项
4.视图层