【微信小程序】全局配置

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
  }
}
相关推荐
2501_915921431 天前
iOS 开发者工具推荐,构建从调试到性能优化的多维度生产力工具链(2025 深度工程向)
android·ios·性能优化·小程序·uni-app·iphone·webview
计算机毕设定制辅导-无忧学长1 天前
基于微信小程序的高校订餐小程序
微信小程序·小程序
從南走到北1 天前
JAVA同城信息付费系统家政服务房屋租赁房屋买卖房屋装修信息发布平台小程序APP公众号源码
java·开发语言·小程序
JIngJaneIL1 天前
远程在线诊疗|在线诊疗|基于java和小程序的在线诊疗系统小程序设计与实现(源码+数据库+文档)
java·数据库·vue.js·spring boot·小程序·毕设·在线诊疗小程序
00后程序员张1 天前
全面解析网络抓包工具使用:Wireshark和TCPDUMP教程
网络·ios·小程序·uni-app·wireshark·iphone·tcpdump
游戏开发爱好者81 天前
Mac 抓包软件怎么选?从 HTTPS 调试、TCP 数据流分析到多工具协同的完整抓包方案
tcp/ip·macos·ios·小程序·https·uni-app·iphone
2501_915918411 天前
苹果上架 iOS 应用的工程实践,一次从零到上线的完整记录
android·ios·小程序·https·uni-app·iphone·webview
從南走到北1 天前
JAVA国际版同城跑腿源码快递代取帮买帮送同城服务源码支持Android+IOS+H5
android·java·ios·微信小程序
大熋1 天前
微信小程序实现下载 上传表格(xls、xlsx)
微信小程序·小程序
千寻技术帮1 天前
50030_基于微信小程序的生鲜配送系统
mysql·微信小程序·源码·安装·文档·ppt·答疑