小程序:全局配置(pages、windows、tabBar)

时间:2020-06-22 13:06:06   收藏:0   阅读:116

技术图片

1、pages:页面

  "pages": [
    "pages/index/index",
    "pages/logs/logs"
  ],

 

2、windows:全局的默认窗口表现,用于设置小程序的状态栏、导航条、标题、窗口背景色。

(1)导航栏颜色:

  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#444",
    "navigationBarTitleText": "WeChat",
    "navigationBarTextStyle": "white"
  },

技术图片

 

 (2)名称:

  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#444",
    "navigationBarTitleText": "cNode",
    "navigationBarTextStyle": "white"
  },

技术图片

 

 (3)下拉刷新:默认为false,设置为true

  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#444",
    "navigationBarTitleText": "cNode",
    "enablePullDownRefresh":true
  },

 

3、tabBar(https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#window

  "tabBar":{
      "list":[
        {
          "pagePath":"pages/index/index",
          "text":"首页"
        },
        {
          "pagePath":"pages/index/index",
          "text":"入门"
        },
        {
          "pagePath":"pages/index/index",
          "text":"消息"
        },
        {
          "pagePath":"pages/index/index",
          "text":"API"
        },
        {
          "pagePath":"pages/index/index",
          "text":"个人"
        }
      ],
      "color":"#2E2E2E",
      "selectedColor":"#F8B7D2",
      "backgroundColor":"#DEE1E6"
  },

效果:

技术图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!