配置项列表

属性类型必填描述平台兼容
globalStyleObject设置默认页面的窗口表现
pagesObject Array设置页面路径及窗口表现
tabBarObject设置底部 tab 的表现
conditionObject启动模式配置
subPackagesObject Array分包加载配置
preloadRuleObject分包预下载规则微信小程序
workersStringWorker 代码放置的目录微信小程序

以下是一个包含了所有配置选项的 pages.json

  1. {
  2. "pages": [{
  3. "path": "pages/component/index",
  4. "style": {
  5. "navigationBarTitleText": "组件"
  6. }
  7. }, {
  8. "path": "pages/API/index",
  9. "style": {
  10. "navigationBarTitleText": "接口"
  11. }
  12. }, {
  13. "path": "pages/component/view/index",
  14. "style": {
  15. "navigationBarTitleText": "view"
  16. }
  17. }],
  18. "condition": { //模式配置,仅开发期间生效
  19. "current": 0, //当前激活的模式(list 的索引项)
  20. "list": [{
  21. "name": "test", //模式名称
  22. "path": "pages/component/view/index" //启动页面,必选
  23. }]
  24. },
  25. "globalStyle": {
  26. "navigationBarTextStyle": "black",
  27. "navigationBarTitleText": "演示",
  28. "navigationBarBackgroundColor": "#F8F8F8",
  29. "backgroundColor": "#F8F8F8",
  30. "usingComponents":{
  31. "collapse-tree-item":"/components/collapse-tree-item"
  32. }
  33. },
  34. "tabBar": {
  35. "color": "#7A7E83",
  36. "selectedColor": "#3cc51f",
  37. "borderStyle": "black",
  38. "backgroundColor": "#ffffff",
  39. "list": [{
  40. "pagePath": "pages/component/index",
  41. "iconPath": "static/image/icon_component.png",
  42. "selectedIconPath": "static/image/icon_component_HL.png",
  43. "text": "组件"
  44. }, {
  45. "pagePath": "pages/API/index",
  46. "iconPath": "static/image/icon_API.png",
  47. "selectedIconPath": "static/image/icon_API_HL.png",
  48. "text": "接口"
  49. }]
  50. }
  51. }