• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

006-小程序基本配置

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

这里的配置指 .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"
    }
  }
}

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
微信小程序book发布时间:2022-07-18
下一篇:
使用Senparc.Weixin.WxOpen开发高可用的微信小程序 - 大西瓜3721发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap