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

单层路径 #115

Open
ahan opened this issue Apr 23, 2019 · 2 comments
Open

单层路径 #115

ahan opened this issue Apr 23, 2019 · 2 comments

Comments

@ahan
Copy link

ahan commented Apr 23, 2019

{
  "pages": [
    {
      "path": "pages/home",
      "config": {
        "navigationBarTitleText": "首页"
      },
      "route": "home"
    },
  ],
}

我使用 route 属性想实现单层路由,即去掉 pages 字样的前缀,但这样写会报错。

检查 dist 下生成的代码,发现 wxml 文件被生成在 pages 文件夹里了

QQ20190424-022119
QQ20190424-022227

我查看了一下源代码,貌似是 mpvue 的关系,但不确定,所以发 issue 问下作者是否可以帮忙看下怎么实现单层路径效果

@F-loat
Copy link
Owner

F-loat commented May 29, 2019

route 这个属性后期废弃掉了,感觉意义不大,我有空具体看下

@ahan
Copy link
Author

ahan commented May 30, 2019

可以考虑保留 route 这个属性,用来改造单层路径,从 /pages/about 到 /about,看起来不那么冗余

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

2 participants