博客列表 >1、安装小程序开发者工具 2、配置小程序底部按钮、顶部窗口 3、根据底部按钮,创建对应页面 4、列出10个组件的使用方法

1、安装小程序开发者工具 2、配置小程序底部按钮、顶部窗口 3、根据底部按钮,创建对应页面 4、列出10个组件的使用方法

小丑0o鱼
小丑0o鱼原创
2021年07月20日 18:08:35427浏览

1、安装小程序开发者工具

前往 开发者工具下载页面 (https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) 根据自己的操作系统下载对应的稳定版安装包进行安装

2、配置小程序底部按钮、顶部窗口
在小程序app.json下,window下配置顶部窗口navigation与底部按钮tabBar

window 配置项

  1. navigationBarBackgroundColor HexColor #000000 导航栏背景颜色,如 #000000
  2. navigationBarTextStyle string white 导航栏标题颜色,仅支持 black / white
  3. navigationBarTitleText string 导航栏标题文字内容
  4. backgroundColor HexColor #ffffff 窗口的背景色
  5. backgroundTextStyle string dark 下拉 loading 的样式,仅支持 dark / light

tabBar 配置项

  1. pagePath string 页面路径,必须在 pages 中先定义
  2. text string tab 上按钮文字
  3. iconPath string 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
  4. selectedIconPath string 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
  1. "window": {
  2. "navigationBarBackgroundColor": "#ffffff",
  3. "navigationBarTextStyle": "black",
  4. "navigationBarTitleText": "默默记账",
  5. "backgroundColor": "#eeeeee",
  6. "backgroundTextStyle": "light",
  7. "enablePullDownRefresh": false
  8. },
  9. "tabBar": {
  10. "color": "#444444",
  11. "selectedColor": "red",
  12. "backgroundColor": "#ffffff",
  13. "position": "bottom",
  14. "borderStyle": "black",
  15. "list": [{
  16. "pagePath": "pages/index/index",
  17. "text": "主页",
  18. "iconPath": "./static/img/1.png",
  19. "selectedIconPath": "./static/img/2.png"
  20. },
  21. {"pagePath": "pages/ad/ad",
  22. "text": "广告",
  23. "iconPath": "./static/img/1.png",
  24. "selectedIconPath": "./static/img/2.png"
  25. },
  26. {"pagePath": "pages/art/art",
  27. "text": "文章",
  28. "iconPath": "./static/img/3.png",
  29. "selectedIconPath": "./static/img/4.png"
  30. },
  31. {
  32. "pagePath": "pages/logs/logs",
  33. "text": "日志",
  34. "iconPath": "./static/img/3.png",
  35. "selectedIconPath": "./static/img/4.png"
  36. }
  37. ]
  38. }
  39. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议