创建页面时,会自动在pages.json中创建对应页面基础信息

配置

  1. {
  2. "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
  3. //tabbar页面配置
  4. {
  5. "path": "pages/index/index",
  6. "style": {
  7. "navigationBarTitleText": "uni-app"
  8. }
  9. }
  10. ,{
  11. "path" : "pages/news/news",
  12. "style" :
  13. {
  14. "navigationBarTitleText": "",
  15. "enablePullDownRefresh": false
  16. }
  17. }
  18. ,{
  19. "path" : "pages/msg/msg",
  20. "style" :
  21. {
  22. "navigationBarTitleText": "",
  23. "enablePullDownRefresh": false
  24. }
  25. }
  26. ,{
  27. "path" : "pages/my/my",
  28. "style" :
  29. {
  30. "navigationBarTitleText": "",
  31. "enablePullDownRefresh": false
  32. }
  33. }
  34. ],
  35. //tabBar配置
  36. "tabBar": {
  37. // 文字颜色
  38. "color":"#323232",
  39. // 选中状态的颜色
  40. "selectedColor":"#ED6384",
  41. // 设置背景色
  42. "backgroundColor":"#FFFFFF",
  43. // 设置上边线的颜色,自由black和white
  44. "borderStyle":"black",
  45. // 对应页面配置
  46. // 有多少个页面就配置多少个
  47. "list": [{
  48. "pagePath":"pages/index/index",
  49. "text":"首页",
  50. "iconPath":"static/tabbar/index.png",
  51. // 最后一定不要有',',否则会报错的
  52. "selectedIconPath":"static/tabbar/indexed.png"
  53. },{
  54. "pagePath":"pages/news/news",
  55. "text":"动态",
  56. "iconPath":"static/tabbar/news.png",
  57. // 最后一定不要有',',否则会报错的
  58. "selectedIconPath":"static/tabbar/newsed.png"
  59. }{
  60. "pagePath":"pages/msg/msg",
  61. "text":"消息",
  62. "iconPath":"static/tabbar/paper.png",
  63. // 最后一定不要有',',否则会报错的
  64. "selectedIconPath":"static/tabbar/papered.png"
  65. }{
  66. "pagePath":"pages/my/my",
  67. "text":"我的",
  68. "iconPath":"static/tabbar/home.png",
  69. // 最后一定不要有',',否则会报错的
  70. "selectedIconPath":"static/tabbar/homeed.png"
  71. }]
  72. }
  73. }

tabbar边线
image.png