吴克
吴克
  • 发布:2020-04-25 13:16
  • 更新:2020-04-25 13:39
  • 阅读:1010

pages.json的条件编译有问题啊

分类:uni-app

"tabBar": {
"color": "#999999",
"selectedColor": "#00b7ff",
// "borderStyle": "black",
"backgroundColor": "#1b2839",
"list":
// 微信不支持svg
[
//#ifdef APP_PLUS || H5 || MP-ALIPAY
{
"pagePath": "pages/tabBar/home/home",
"iconPath": "static/img/tabBar/cube.svg",
"selectedIconPath": "static/img/tabBar/cube-on.svg",
"text": "喜加一"
},
//#endif
//#ifdef MP-WEIXIN
{
"pagePath": "pages/tabBar/home/home",
"iconPath": "static/img/tabBar/cube.png",
"selectedIconPath": "static/img/tabBar/cube-on.png",
"text": "喜加一"
},
//#endif
// {
// "pagePath": "pages/tabBar/cart/cart",
// "iconPath": "static/img/tabBar/star.svg",
// "selectedIconPath": "static/img/tabBar/star-on.svg",
// "text": "关注"
// },
//#ifdef APP_PLUS || H5 || MP-ALIPAY
{
"pagePath": "pages/tabBar/user/user",
"iconPath": "static/img/tabBar/happy.svg",
"selectedIconPath": "static/img/tabBar/happy-on.svg",
"text": "我的"
}
//#endif
//#ifdef MP-WEIXIN
{
"pagePath": "pages/tabBar/user/user",
"iconPath": "static/img/tabBar/happy.png",
"selectedIconPath": "static/img/tabBar/happy-on.png",
"text": "我的"
},
//#endif
]
}

比如微信不支持svg图标,所以我tabBar里面这么配,但是会报错,见附件

2020-04-25 13:16 负责人:无 分享
已邀请:
吴克

吴克 (作者)

总结下问题:pages.json条件编译和JSHINT 本来因为逗号问题有矛盾
而且当前版本,HbuilderX 2.6.16 JSHINT不通过,不让编译成功

该问题目前已经被锁定, 无法添加新回复