小程序根目录下的 app.json 文件用来对微信小程序进行全局配置。
https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html
每一个小程序页面也可以使用 .json 文件来对本页面的窗口表现进行配置。页面中配置项在当前页面会覆盖 app.json 的 window 中相同的配置项。
https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/page.html
全局配置和页面配置官网文档讲的已经非常清晰, 就是刚开始的时候,容易踩一些坑,可能这些坑就是配置的问题, 所以,虽然不用记住所有的具体配置,但是记住有哪些可以配置的,用的时候用上还是很有必要。
全局配置
navigateToMiniProgramAppIdList:需要跳转的小程序列表permission:小程序接口权限相关设置usingComponents:全局自定义组件配置window -> enablePullDownRefresh:是否开启当前页面下拉刷新。window -> pageOrientation:屏幕旋转设置,支持 auto / portrait / landscapetabBar -> position:tabBar 的位置,仅支持 bottom / top页面配置
enablePullDownRefresh:是否开启当前页面下拉刷新。pageOrientation:屏幕旋转设置,支持 auto / portrait / landscapedisableScroll:设置为 true 则页面整体不能上下滚动。只在页面配置中有效,无法在 app.json 中设置