Closed tomexx closed 6 years ago
It's probably enough to introduce another check using _current and _history.length properties. I can create a PR later.
The problem is that the package listens on route enter and doesn't know if it went back by a button in the menu, the back button you added or the native back button.
@MaximVanhove Yes... then that's no use in certain scenarios like I have... :/
Could you explain your scenarios? Maybe I can help.
I need to differentiate these two scenarios:
1) Page A -> navigate to Page B -> navigate to Page A
2) Page A -> navigate to Page B -> back button (returning to Page A)
Page A -> navigate to Page B -> navigate to Page A
the third step should be stored as a separate item in history array, then it would work as expected with all the methods I think
I think you can use the click event on the button and emit an event. What would you like to do if you click the back button?
Well, that's tricky. I need to watch $route changes and then show or hide some component, depending on if user went back from certain route or came there from another place. Your package would solve this easily without handling events which would add complexity
I guess you could fork my repo and modify it so that it only writes history. Then use the click event on the button to go back to the last.
Hi, there is one problem that made this plugin unusable for me. I need to differentiate between going back using back button and navigating through pages.
Page A => Page B => Page A (now this.$routerHistory.hasForward() returns true, even when I have not used Back button)