位置: IT常识 - 正文
推荐整理分享微信小程序开发 app.json全局配置(微信小程序开发零基础入门),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:微信小程序开发教程,微信小程序开发零基础入门,微信小程序开发公司十大排名,微信小程序开发平台官网,微信小程序开发平台,微信小程序开发一个多少钱,微信小程序开发平台,微信小程序开发公司,内容如对您有帮助,希望把文章链接给更多的朋友!
JSON 是一种数据格式,在实际开发中,JSON 总是以配置文件的形式出现。
app.json 是当前小程序的全局配置,可以通过app.json对小程序项目进行设置所有页面路径、窗口外观、界面表现、底部 tab 等。
{"pages": ["pages/index/index","pages/mine/mine","pages/play/play","pages/mycard/mycard","pages/Record/Record","pages/prize/prize","pages/details/details","pages/lottery/lottery","pages/ar/ar"],"window": {"backgroundTextStyle": "light","navigationBarBackgroundColor": "#fff","navigationBarTitleText": "我是展示标题","navigationBarTextStyle": "black"},"tabBar": {"backgroundColor": "#FFFFFF","color": "#181818","selectedColor": "#221415","list": [{"pagePath": "pages/ar/ar","iconPath": "images/tabbar/arg.png","selectedIconPath": "images/tabbar/AR.png","text": "AR"},{"pagePath": "pages/play/play","iconPath": "images/tabbar/play.png","selectedIconPath": "images/tabbar/playg.png","text": "玩法"},{"pagePath": "pages/index/index","iconPath": "images/tabbar/mine.png","selectedIconPath": "images/tabbar/my.png","text": "我的"}]},"usingComponents": {"van-image": "@vant/weapp/image/index","van-field": "@vant/weapp/field/index","van-divider": "@vant/weapp/divider/index","van-button": "@vant/weapp/button/index","van-toast": "@vant/weapp/toast/index"},"requiredPrivateInfos": ["getLocation"],"permission": {"scope.userLocation": {"desc": "你的位置信息将用于小程序位置接口的效果展示"}},"sitemapLocation": "sitemap.json"}pages配置项是一个数组,主要用于记录页面路径。
第一项路径是小程序默认进入的首页
"pages": ["pages/index/index","pages/mine/mine","pages/play/play","pages/mycard/mycard","pages/Record/Record","pages/prize/prize","pages/details/details","pages/lottery/lottery","pages/ar/ar"],window配置项主要用于更改所有页面的状态栏、导航栏、标题、窗口背景色等。
"window": {"backgroundTextStyle": "light","navigationBarBackgroundColor": "#fff","navigationBarTitleText": "我是展示标题","navigationBarTextStyle": "black"},tarBar如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。
"tabBar": {"backgroundColor": "#FFFFFF","color": "#181818","selectedColor": "#221415","list": [{"pagePath": "pages/ar/ar","iconPath": "images/tabbar/arg.png","selectedIconPath": "images/tabbar/AR.png","text": "AR"},{"pagePath": "pages/play/play","iconPath": "images/tabbar/play.png","selectedIconPath": "images/tabbar/playg.png","text": "玩法"},{"pagePath": "pages/index/index","iconPath": "images/tabbar/mine.png","selectedIconPath": "images/tabbar/my.png","text": "我的"}]},usingComponents在 app.json 中
上一篇:ElementUI中<el-form>标签中 ref、:model、:rules 的作用
下一篇:JavaScript数组every方法(JavaScript数组长度)
友情链接: 武汉网站建设