1.认识app.json

  1. {
  2. "pages":[
  3. "pages/index/index",
  4. "pages/logs/logs"
  5. ],
  6. "window":{
  7. "backgroundTextStyle":"light",
  8. "navigationBarBackgroundColor": "#fff",
  9. "navigationBarTitleText": "Weixin",
  10. "navigationBarTextStyle":"black"
  11. },
  12. "style": "v2",
  13. "sitemapLocation": "sitemap.json"
  14. }
  • page 页面配置
  • window 窗口配置
    • backgroundTextStyle 在页面下拉刷新时三个加载点的颜色
    • navigationBarBackgroundColor 设置导航栏背景颜色
    • navigationBarTitleText 设置导航栏想要显示的名称
    • navigationBarTextStyle 导航栏字体颜色
    • enablePullDownRefresh 下拉刷新
    • backgroundColor 下拉刷新时背景的颜色
  • sitemapLocation 是否允许小程序进行站内搜索(参考)

    2.基础操作之底部触摸栏

    1. "tabBar": {
    2. "selectedColor": "",
    3. "borderStyle": "",
    4. "list": [{
    5. "pagePath": "pagePath",
    6. "text": "text",
    7. "iconPath": "iconPath",
    8. "selectedIconPath": "selectedIconPath"
    9. },{
    10. "pagePath": "pagePath",
    11. "text": "text",
    12. "iconPath": "iconPath",
    13. "selectedIconPath": "selectedIconPath"
    14. }]
    15. }
  • pagepath 指的是页面路径

  • text 指的是触摸栏的名称
  • iconpath 指的是未触摸时的状态
  • selectedIconPath 指的是触摸时展示的状态
  • selectedColor 设置触摸后的字体颜色
  • borderStyle 设置底部导航栏线的样式