ionic-team / ionic-team/ionic-framework
feat: ion-nav / ion-router: ability to swap current view
- 主要言語
- TypeScript
- スター
- 52.7k
- フォーク
- 13.3k
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 51
説明
# Feature Request
**Ionic version:**
[x] **5.1.0**
**Describe the Feature Request**
Currently there is not a way to swap the current view in the navigation stack vs. pushing or popping.
For example, a simple contact management app might use a route '/contacts/:contactId'.
If the app provides a `Next` button then it is not clear how to show the next contact with the appropriate url while avoiding continuing to push new views onto the navigation stack.
Currently it keeps adding new views to the stack so the user experience would be:
- click on contact A
- click `next` to show contact B
- click `next` to show contact C
- now all the views are in the stack and the user needs to back through all of them
Swapping views in the stack is common for many mobile apps (email, contacts, etc.)
**Describe Preferred Solution**
One possible approach would be to add `swap` to the values for `RouterDirection`. This could then be passed to `ion-nav` so it could swap the view vs. pushing a new view onto the stack.
`ion-nav` could also be updated to expose a `swap` method.
コントリビューションガイド
評価
この issue はまだ評価されていません。