myjf007

Results 20 comments of myjf007

比如我在index下,如果这样执行 `this.$switch('home');` 会报 `switchTab:fail page "pages/home/$page" is not found` 如果这样 `this.$switch('home/home');` 会报 `switchTab:fail page "pages/index/home/$page" is not found`

路由就是这样配置的 ` wxpage.A({ config:{ route: '/pages/$page/$page' } }) ` 这是按示例来配置的 ` 示例: const { A } = require('./wxpage') A({ config: { route: '/pages/$page' // $page 会被替换成页面名 }, onLaunch: function ()...

![default](https://user-images.githubusercontent.com/16434947/51813768-ffc45e00-22f2-11e9-8afc-31bd6cb1f171.png) route只能替换一个

如果强制这样写 ![default](https://user-images.githubusercontent.com/16434947/51813797-2e423900-22f3-11e9-9ce6-d11ec7e93fa7.png) ,那是没有问题

![default](https://user-images.githubusercontent.com/16434947/51813399-04881280-22f1-11e9-8ea5-d61d6e169012.png) 类似这样的结构,route要如何配置呢

```js A({ config: { route: ['/pages/$page', '/packageA/pages/$page'], resolvePath: function (name) { return `/pages/${name}` } } }); ``` 我是按这样配置了,然后在pages/index要跳转到packageA的cat文件 ```js this.$route('cat') ``` 会提示 ```js navigateTo:fail page "pages/cat" is not found ```

在packageA下有,这样分包模式下,this.$route(pagename),要如何配置route才能打开packageA下的cat界面呢

框架中有 ```js isInPackageA ``` 这个方法么?还是说需要自己实现