在当前版本中,我们可以快速的新建并且新建页面。

在app.json文件中输入

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

输入"pages/index/index" 后,小程序的编辑工具会自动在根目录建立

  pages文件夹

  index文件夹

  index命名的.js  .json  .wxss  .wxml 文件

微信小程序(2)——新建页面  

 

 app.json介绍


 

 app.json是每个小程序必有切唯一的。

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

 

app.json 配置项列表

属性 类型 必填 描述
pages String Array 设置页面路径
window Object 设置默认页面的窗口表现
tabBar Object 设置底部 tab 的表现
networkTimeout Object 设置网络超时时间
debug Boolean 设置是否开启 debug 模式

 

 

{
  "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
}

 

 

 

 

 

 

 

相关文章:

  • 2022-01-07
  • 2022-01-08
  • 2021-05-23
  • 2021-06-20
  • 2021-06-21
  • 2021-09-18
  • 2021-12-19
猜你喜欢
  • 2022-01-07
  • 2022-01-07
  • 2021-12-09
  • 2021-09-07
  • 2022-12-23
  • 2021-09-28
相关资源
相似解决方案