当前位置:   article > 正文

详解小程序的app.json_app.json window["scrollindicator"]

app.json window["scrollindicator"]

前言:

        小程序的配置app.json 相当的重要,这里说一说他的各种配置代表的参数

官网配置入口

我自己的app.json代码:

  1. {
  2. "pages": [
  3. "pages/index",
  4. "pages/Play/play",
  5. "pages/my/my",
  6. "pages/search/search",
  7. "pages/trump/trump"
  8. ],
  9. "window": {
  10. "navigationBarBackgroundColor": "#2b2e33",
  11. "navigationBarTextStyle": "white",
  12. "navigationBarTitleText": "芒果TV",
  13. "backgroundColor": "#fff",
  14. "backgroundTextStyle": "light"
  15. },
  16. "tabBar": {
  17. "color": "#74777e",
  18. "selectedColor": "#f06000",
  19. "borderStyle": "white",
  20. "backgroundColor": "#fff",
  21. "list": [
  22. {
  23. "pagePath": "pages/index",
  24. "iconPath": "image/jx.png",
  25. "selectedIconPath": "image/jxselect.png",
  26. "text": "精选"
  27. },
  28. {
  29. "pagePath": "pages/search/search",
  30. "iconPath": "image/ss.png",
  31. "selectedIconPath": "image/ssselect.png",
  32. "text": "搜索"
  33. },
  34. {
  35. "pagePath": "pages/trump/trump",
  36. "iconPath": "image/wp.png",
  37. "selectedIconPath": "image/wpselect.png",
  38. "text": "王牌强档"
  39. },
  40. {
  41. "pagePath": "pages/my/my",
  42. "iconPath": "image/my.png",
  43. "selectedIconPath": "image/myselect.png",
  44. "text": "我的"
  45. }
  46. ]
  47. },
  48. "networkTimeout": {
  49. "request": 10000,
  50. "connectSocket": 10000,
  51. "uploadFile": 10000,
  52. "downloadFile": 10000
  53. },
  54. "debug": true,
  55. "sitemapLocation": "sitemap.json"
  56. }

配置详解:

1、pages  这里配置的是你的页面,所有的pages下面的页面都得配置才能调用,不配置会报错,并且页面出不来

  1. "pages": [
  2. "pages/index",
  3. "pages/Play/play",
  4. "pages/my/my",
  5. "pages/search/search",
  6. "pages/trump/trump"
  7. ],

2、window  用于设置小程序的状态栏、导航条、标题、窗口背景色。

  1. "window": {
  2. "navigationBarBackgroundColor": "#2b2e33",//导航栏背景图颜色
  3. "navigationBarTextStyle": "white",//导航栏标题颜色 white/black
  4. "navigationBarTitleText": "芒果TV",//导航栏中间的文字
  5. "backgroundColor": "#fff", //窗口背景色
  6. "backgroundTextStyle": "light"
  7. },

3、分包-来写路由,这样可以将小程序的上限变成8m

  1. "tabBar": {
  2. "color": "#74777e",
  3. "selectedColor": "#f06000",
  4. "borderStyle": "white",
  5. "backgroundColor": "#fff",
  6. "list": [
  7. {
  8. "pagePath": "pages/index",
  9. "iconPath": "image/jx.png",
  10. "selectedIconPath": "image/jxselect.png",
  11. "text": "精选"
  12. },
  13. {
  14. "pagePath": "pages/search/search",
  15. "iconPath": "image/ss.png",
  16. "selectedIconPath": "image/ssselect.png",
  17. "text": "搜索"
  18. },
  19. {
  20. "pagePath": "pages/trump/trump",
  21. "iconPath": "image/wp.png",
  22. "selectedIconPath": "image/wpselect.png",
  23. "text": "王牌强档"
  24. },
  25. {
  26. "pagePath": "pages/my/my",
  27. "iconPath": "image/my.png",
  28. "selectedIconPath": "image/myselect.png",
  29. "text": "我的"
  30. }
  31. ]
  32. },

说了这么多,也就是底部导航栏

4、networkTimeout

5、debug

6、sitemapLocation

小程序根目录下的 sitemap.json 文件用于配置小程序及其页面是否允许被微信索引,文件内容为一个 JSON 对象,如果没有 sitemap.json ,则默认为所有页面都允许被索引;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/281017
推荐阅读
相关标签
  

闽ICP备14008679号