zoukankan      html  css  js  c++  java
  • 每天学习一点点:【配置】

    app.json文件用来对微信小程序进行全局配置,决定页面文件的路径、窗口表现、设置网络超时时间、设置多tab等。

    {
      "pages": [
        "pages/index/index",
        "pages/logs/index"
      ],
      "window": {
        "navigationBarTitleText": "Demo"
      },
      "tabBar": {
        "list": [{
          "pagePath": "pages/index/index",
          "text": "首页"
        }, {
          "pagePath": "pages/logs/logs",
          "text": "日志"
        }]
      },
      "networkTimeout": {
        "request": 10000,
        "downloadFile": 10000
      },
      "debug": true
    }

    app.json配置项列表

    属性

    类型

    必填

    描述

    Pages

    String Array

    设置页面路径

    window

    Object

    设置默认页面的窗口表现

    tabBar

    Object

    设置底部tab的表现

    networkTimeout

    Object

    设置网络超时时间

    debug

    Boolean

    设置是否开启debug模式

    *****pages属性******:

    它接受一个数组,每一项都是字符串,来指定小程序有哪些页面组成。每一项代表对应页面的【路径+文件名】信息,数组的第一项代表小程序的初始页面。小程序中新增/减少页面,都需要对pages中的数组进行修改。

    文件名不需要写文件后缀,因为框架会自动去寻找路径下: .json , .js , .wxml ,.wxss 四个文件进行整合。

    如开发目录为

    如开发目录为:

    pages/

    pages/index/index.wxml

    pages/index/index.js

    pages/index/index.wxss

    pages/logs/logs.wxml

    pages/logs/logs.js

    app.js

    app.json

    app.wxss

    则需要在app.json中写:

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

    *****window属性******:

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

    属性

    类型

    默认值

    描述

    最低版本

    navigationBackgroundColor

    HexColor

    #000000

    导航栏背景颜色,如“#000000

    navigationBarTextStyle

    String

    white

    导航栏标题颜色,仅支持black/white

    navigationBarTitleText

    String

    导航栏标题文字内容

    navigationStyle

    String

    default

    导航栏样式,仅支持default/custom

    Custom 模式可自定义导航栏,只保留右上角胶囊状的按钮

    微信版本

    6.6.0

    backgroundColor

    String

    #ffffff

    窗口背景色

    backgroundTextStyle

    String

    dark

    下拉loading的样式,仅支持dark/light

    backgroundColorTop

    String

    #ffffff

    顶部窗口的背景色,仅ios支持

    微信版本

    6.5.16

    backgroundColorBottom

    String

    #ffffff

    底部窗口的背景色,仅IOS支持

    微信版本

    6.5.16

    enablePullDownRefresh

    Boolean

    False

    是否开启下拉刷新,详见页面相关事件的处理函数

    onReachBottomDistance

    Number

    50f

    页面上拉触底事件触发时距页面底部距离,单位为px

     
  • 相关阅读:
    [Redux-Observable && Unit Testing] Use tests to verify updates to the Redux store (rxjs scheduler)
    [Redux-Observable && Unit Testing] Mocking an ajax request when testing epics
    [Redux-Observable && Unit testing] Testing the output of epics
    [React] Create a queue of Ajax requests with redux-observable and group the results.
    [React] Compound Component (React.Children.map & React.cloneElement)
    [Express] Upload Files with Express
    [Python] List & Object spread in Python
    [Angular & Unit Testing] Testing a RouterOutlet component
    [Angular & Unit Testing] TestBed.get vs Injector
    各司其职的标签
  • 原文地址:https://www.cnblogs.com/1218-mzc/p/9234760.html
Copyright © 2011-2022 走看看