【微信小程序】全局配置

1. 全局配置文件及常用的配置项

2.window

(1).小程序窗口的组成部分

(2). 了解 window 节点常用的配置项

(3). 设置导航栏的标题


(4). 设置导航栏的背景色


(5). 设置导航栏的标题颜色



(6). 全局开启下拉刷新功能

(7). 设置下拉刷新时窗口的背景色


(8).设置下拉刷新时 loading 的样式



(9).设置上拉触底的距离

3.tabBar

(1).什么是 tabBar


(2).tabBar 的 6 个组成部分


(3).tabBar 节点的配置项

(4).每个 tab 项的配置选项

4.案例:配置 tabBar

(1).需求描述


(2).实现步骤

步骤1 - 拷贝图标资源


步骤2 - 新建 3 个对应的 tab 页面



步骤3 - 配置 tabBar 选项

完整的配置代码

javascript 复制代码
{
  "pages": [
    "pages/home/home",
    "pages/message/message",
    "pages/contact/contact"
  ],
  "window": {
    "navigationBarTextStyle":"black",
    "navigationBarTitleText": "微信小程序",
    "navigationBarBackgroundColor": "#00ffff",
    "backgroundColor": "#eee",
    "enablePullDownRefresh": true,
    "backgroundTextStyle": "light"
  },
  "style": "v2",
  "componentFramework": "glass-easel",
  "sitemapLocation": "sitemap.json",
  "lazyCodeLoading": "requiredComponents",
  "tabBar": {
    "list": [
      {
      "pagePath": "pages/home/home",
      "text": "首页",
      "iconPath": "images/tabs/home.png", //相对路径
      "selectedIconPath": "images/tabs/home-active.png"
    },
      {
      "pagePath": "pages/message/message",
      "text": "消息",
      "iconPath": "images/tabs/message.png",
      "selectedIconPath": "images/tabs/message-active.png"
    },
      {
      "pagePath": "pages/contact/contact",
      "text": "联系我们",
      "iconPath": "images/tabs/contact.png",
      "selectedIconPath": "images/tabs/contact-active.png"
    }
  ],
  "color": "#000000",
  "selectedColor": "#ff0000",
  "backgroundColor": "#eee",
  "position":"bottom", // top或者bottom
  "borderStyle": "white"  // white或者black
  }
}
相关推荐
沉默-_-3 分钟前
微信小程序网络请求 wx.request 详解
网络·学习·微信小程序·小程序
2501_915909061 小时前
设置了 SSL Pinning 与双向 TLS 验证要怎么抓包
网络·网络协议·ios·小程序·uni-app·iphone·ssl
沉默-_-2 小时前
微信小程序页面配置详解
学习·微信小程序·apache·微信开发者工具
月空MoonSky3 小时前
解决使用Notepad++出现异型字或者繁体字体问题
java·javascript·notepad++
龙兵科技小付说5 小时前
不同价格的上门做饭小程序APP都有什么功能?
小程序·软件开发·上门做饭
2501_916007477 小时前
如何查看 iOS 设备系统与硬件信息,iOS系统信息显示工具
android·ios·小程序·https·uni-app·iphone·webview
逆龙泰氽8 小时前
微信小程序开发04-1(小程序API)
微信小程序·小程序
说私域8 小时前
AI智能名片S2B2C商城小程序在微商中的应用与影响
大数据·人工智能·小程序·流量运营
S0linteeH8 小时前
Multiple Notepad++ Flaws Let Attackers Execute Arbitrary Code
notepad++
苏苏哇哈哈9 小时前
微信小程序实现高性能动态配置水滴凹槽、凸起Tabbar 组件
微信小程序·小程序