ionic-team / ionic-team/ionic-framework

bug: vue, memoryRouter + tapping tab while inside nested route does nothing

未关闭
#29,785 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
package: vue type: bug
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 14 小时
30 天内合并 PR
50

描述

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

When using memory history router and tapping on ion-tab while being on a nested route, nothing happens.
While debugging I found that `route.position` is `undefined` when trying to reset to root page. That maybe expected, not sure.

When using web history router, navigation to root page works as expected. I have to use memory router to make swipe back working inside PWA.

image

### Expected Behavior

Navigate back to the root page of the tab.

### Steps to Reproduce

1. Clone (ionic-vue-conference-app)[https://github.com/ionic-team/ionic-vue-conference-app]
2. Use memory router in router.ts (`createMemoryHistory`)
3. Click on any session on sessions tab
4. Click on schedule tab in the tab bar
5. Nothing happens

### Code Reproduction URL

https://github.com/ionic-team/ionic-vue-conference-app

### Ionic Info

```
[ERROR] Invalid project type: vue-vite (project config: ./ionic.config.json).

Project type must be one of: angular, ionic-angular, ionic1, custom, react, vue

Bad project type: undefined
```

### Additional Information

_No response_

贡献指南

打开贡献指南

调研方向

在 ionic-vue-conference-app 中使用 router.ts 里的 createMemoryHistory 重现该问题:从 sessions 标签页打开一个会话,然后点击 schedule 标签页。检查标签页导航,以及读取 route.position 的根页面重置路径。完成标准是:从嵌套路由点击另一个标签页时,会导航回该标签页的根页面。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。