小程序模板網(wǎng)

微信小程序tabBar不顯示:缺少文件,錯(cuò)誤信息:error:iconPath=

發(fā)布時(shí)間:2018-04-08 10:41 所屬欄目:小程序開發(fā)教程
作者:小程序;來自原文地址;本文中提及了一個(gè)較為常見的錯(cuò)誤,這個(gè)錯(cuò)誤在預(yù)覽時(shí)經(jīng)常遇到,這個(gè)說明將幫助到大家;

1.list中的第一個(gè)tab的地址必須定義在pages 中

 "pages":[
    "pages/Intent/Intent",
    "pages/Services/Services",
    "pages/Profile/Profile"
  ],

2.list 中的 pagePath 必須是正確地址,如果出現(xiàn)不顯示的問題,99%是因?yàn)榈刂凡徽_

"selectedIconPath": "pages/Image/ic_tab_profile_select.png",  #此處也錯(cuò)了,此處pages該有斜杠/
"iconPath": "pages/Image/ic_tab_profile_normal.png",  
"pagePath": "/pages/Profile/Profile",     #如此處錯(cuò)了pages前面不該有斜杠/
"text": "我的"

正確寫法為:

 "list": [{  
     "selectedIconPath": "/pages/Image/ic_tab_buycar_select.png",  
     "iconPath": "/pages/Image/ic_tab_buycar_normal.png",  
     "pagePath": "pages/Intent/Intent",  
     "text": "購車"  
   },
    ...
]

項(xiàng)目結(jié)構(gòu)為



本文地址:http://m.u-renovate.com/wxmini/doc/course/23125.html 復(fù)制鏈接 如需定制請(qǐng)聯(lián)系易優(yōu)客服咨詢:800182392 點(diǎn)擊咨詢
QQ在線咨詢
AI智能客服 ×