admin管理员组文章数量:1336148
I am using the vue-router for overlay menu's on mobile. This means when a user selects a filter link a full overlay will slide in from the left with filters options.
A user can of course select a filter from the default view, go back to the default view and select a filter again. This will cause the history to contain:
- Default view
- Filter view
- Default view
- Filter view
When a user clicks back multiple times it will iterate through the actions in reverse while preferably if there is an overlay active it should go back to the default view and then simply omit the history API data and continue with the default history data.
To get this done I guess I could use named routes and differentiate from a root
(default) route between a non-root
(overlay). If I want to go back on a root I should then delete the history API data?
Any thoughts on how to get this done?
The browser history can not be manipulated so how do I go back to a state before all the manipulation that has been done by the vue-router
?
I am using the vue-router for overlay menu's on mobile. This means when a user selects a filter link a full overlay will slide in from the left with filters options.
A user can of course select a filter from the default view, go back to the default view and select a filter again. This will cause the history to contain:
- Default view
- Filter view
- Default view
- Filter view
When a user clicks back multiple times it will iterate through the actions in reverse while preferably if there is an overlay active it should go back to the default view and then simply omit the history API data and continue with the default history data.
To get this done I guess I could use named routes and differentiate from a root
(default) route between a non-root
(overlay). If I want to go back on a root I should then delete the history API data?
Any thoughts on how to get this done?
The browser history can not be manipulated so how do I go back to a state before all the manipulation that has been done by the vue-router
?
1 Answer
Reset to default 4Try navigating around the filter views by calling this.$router.replace()
. That way, back will take you to the page before default.
本文标签: javascriptVue router clear history API when going back from a default viewStack Overflow
版权声明:本文标题:javascript - Vue router clear history API when going back from a default view? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742396252a2466981.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论