006-小程序基本配置

这里的配置指 .json文件,小程序的项目配置泛指app.json



app.json中我们可以定义

  • 页面路径
  • 组件引用
  • 默认窗口样式
  • 底部导航栏
  • 权限声明
  • 插件引入

更多app.json可配置的信息可参考全局配置 全局配置-官方文档

《圈圈》项目的app.json配置如下:

{
  "pages": [
    "pages/home/home",
    "pages/publish/publish",
    "pages/me/me",
    "pages/homeDetail/homeDetail",
    "pages/history/history",
    "pages/collect/collect",
    "pages/advance/advance",
    "pages/replay/replay",
    "pages/search/index",
    "pages/scratch/index"
  ],
  "usingComponents": {
    "van-nav-bar": "@vant/weapp/nav-bar/index",
    "van-tabbar": "@vant/weapp/tabbar/index",
    "van-tabbar-item": "@vant/weapp/tabbar-item/index",
    "van-divider": "@vant/weapp/divider/index",
    "van-button": "@vant/weapp/button/index",
    "van-icon": "@vant/weapp/icon/index",
    "van-dialog": "@vant/weapp/dialog/index",
    "van-image": "@vant/weapp/image/index",
    "van-toast": "@vant/weapp/toast/index"
  },
  "window": {
    "backgroundColor": "#F6F6F6",
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#F6F6F6",
    "navigationBarTitleText": "圈  圈",
    "navigationBarTextStyle": "black",
    "navigationStyle": "custom"
  },
  "tabBar": {
    "selectedColor": "#d81e06",
    "backgroungColor": "#ffffff",
    "borderStyle": "white",
    "list": [
      {
        "pagePath": "pages/home/home",
        "text": "广场",
        "iconPath": "images/tab/home_unselect.png",
        "selectedIconPath": "images/tab/home_select.png"
      },
      {
        "pagePath": "pages/publish/publish",
        "text": "发布",
        "iconPath": "images/tab/publish_unselect.png",
        "selectedIconPath": "images/tab/publish_select.png"
      },
      {
        "pagePath": "pages/me/me",
        "text": "我的",
        "iconPath": "images/tab/me_unselect.png",
        "selectedIconPath": "images/tab/me_select.png"
      }
    ]
  },
  "sitemapLocation": "sitemap.json",
  "permission": {
    "scope.userLocation": {
      "desc": "你的位置信息将用于小程序位置接口的效果展示"
    },
    "openapi": [
      "security.msgSecCheck",
      "security.imgSecCheck"
    ]
  },
  "plugins": {
    "chooseLocation": {
      "version": "1.0.6",
      "provider": "wx76a9a06e5b4e693e"
    }
  }
}
posted @ 2021-10-19 09:05  龙衣  阅读(40)  评论(0编辑  收藏  举报