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

快应用路由配置不能以 / 开头 #507

Open
WJCHumble opened this issue Dec 12, 2020 · 0 comments
Open

快应用路由配置不能以 / 开头 #507

WJCHumble opened this issue Dec 12, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@WJCHumble
Copy link

WJCHumble commented Dec 12, 2020

bug描述

router.config.js 中配置的 path 必须带 /,这样在编译成快应用的时候也会出现 /,但是快应用的路由配置规定不能以 / 开头。

复现bug的步骤

例如这样配置 cml 项目的 router.config.js:

{
  "mode": "hash",
  "domain": "https://api.chameleon.com",
  "routes":[
    {
      "url": "/",
      "path": "/pages/index/index",
      "name": "首页",
      "mock": "index.php"
    }
  ]
}

编译成的快应用的路由:

"router": {
        "pages": {
            "/pages/index": {
                "component": "index",
                "path": "pages/index/index"
            }
        },
        "entry": "/pages/index"
    }

pages 里面的 key 不能以 / 开始,下面这样才是合法的:

"router": {
        "pages": {
            "pages/index": {
                "component": "index",
                "path": "pages/index/index"
            }
        },
        "entry": "pages/index"
    }

问题截图

编译环境信息

  • chameleon-tool 版本:[e.g.0.1.0]
  • nodejs版本、npm版本:[node v8.11.4、npm 5.6.0]
  • 电脑操作系统: [e.g. macOS High Sierra 10.13.6]

运行环境信息

  • 端版本: [e.g. 微信小程序 7.0.3、weex 2.0、手机Safari浏览器 、PC Chrome浏览器 1.30]
  • 手机机型: [e.g. iPhone6 12.0]
@WJCHumble WJCHumble added the bug Something isn't working label Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant