Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

入口文件的config.tabBar里,如果key值带有引号,编译出来的json会有问题 #235

Closed
zombieyang opened this issue Jul 1, 2018 · 0 comments

Comments

@zombieyang
Copy link

zombieyang commented Jul 1, 2018

这样子是正常的。

    tabBar: {
       list: [{
        pagePath: "pages/recommend/index",
        iconPath: "style/images/icon_home_normal.png",
        selectedIconPath: "style/images/icon_home_selected.png",
        text: "推荐"
      },
      {
        pagePath: "pages/publish/index",
        iconPath: "style/images/tabbar_icon_hot_nor.png",
        selectedIconPath: "style/images/tabbar_icon_hot_act.png",
        text: "发表"
      },
      {
        pagePath: "pages/user/index",
        iconPath: "style/images/icon_channel_normal.png",
        selectedIconPath: "style/images/icon_channel_selected.png",
        text: "我的"
      }]

如下则会有问题:

    tabBar: {
       "list": [{
        "pagePath": "pages/recommend/index",
        "iconPath": "style/images/icon_home_normal.png",
        "selectedIconPath": "style/images/icon_home_selected.png",
        "text": "推荐"
      },
      {
        "pagePath": "pages/publish/index",
        "iconPath": "style/images/tabbar_icon_hot_nor.png",
        "selectedIconPath": "style/images/tabbar_icon_hot_act.png",
        "text": "发表"
      },
      {
        "pagePath": "pages/user/index",
        "iconPath": "style/images/icon_channel_normal.png",
        "selectedIconPath": "style/images/icon_channel_selected.png",
        "text": "我的"
      }]
    }

编译出来会产生这样的json:


  "tabBar": {
    "undefined": [
      {
        "undefined": "推荐"
      },
      {
        "undefined": "发表"
      },
      {
        "undefined": "我的"
      }
    ]
  }

看了下代码,你们是采用语法分析的形式解析入口文件。所以我猜测是编译的时候没有兼容带引号的key值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant