Allow multiple push with different state within the same path #2294
Labels
enhancement
New feature or request
has workaround
A workaround has been found to deal with the issue
What problem is this solving
Currently, Vue Router prevents pushing the same path multiple times, even if the state differs. This restriction limits the ability to manage state changes effectively within the same route. I propose an enhancement to allow multiple pushes to the same path if the state is different.
me.
Benefits
Providing this feature will align Vue Router with modern state management practices and enhance its capabilities in dynamic applications.
Thank you for considering this enhancement. I look forward to your feedback and any further discussion on this proposal.
Proposed solution
Implement a check within the push method to determine if the state has changed. If the state is different, allow the push to proceed even if the path is the same. (maybe check state change in
isSameRouteLocation
)Describe alternatives you've considered
As a temporary workaround, we can append a query parameter to the path, but this approach clutters the URL, and there are times when changing URL is not ideal.
The text was updated successfully, but these errors were encountered: