1.全局配置

文档 https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html

app.json三个重要的配置:

  • pages 页面路径
  • window 标题栏
  • tarBar 导航栏(关联page)

image.png

  1. {
  2. "pages": [
  3. "pages/index/index",
  4. "pages/home/home"
  5. ],
  6. "window": {
  7. "navigationBarBackgroundColor": "#FFDAB9",
  8. "navigationBarTextStyle": "black",
  9. "navigationBarTitleText": "沐风的第一个小程序"
  10. },
  11. "tabBar": {
  12. "selectedColor": "#CD5C5C",
  13. "list": [
  14. {
  15. "pagePath": "pages/index/index",
  16. "text": "首页",
  17. "iconPath": "static/tabbar/ic_menu_choice_nor.png",
  18. "selectedIconPath": "static/tabbar/ic_menu_choice_pressed.png"
  19. },
  20. {
  21. "pagePath": "pages/home/home",
  22. "text": "我的",
  23. "iconPath": "static/tabbar/ic_menu_me_nor.png",
  24. "selectedIconPath": "static/tabbar/ic_menu_me_pressed.png"
  25. }
  26. ]
  27. },
  28. "sitemapLocation": "sitemap.json"
  29. }

2.页面配置

<page name>.json

  • 只能配置:window属性