vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.75k stars 1.15k forks source link

A way to detect if user has history on current site #2175

Closed AlexXanderGrib closed 4 months ago

AlexXanderGrib commented 4 months ago

What problem is this solving

Proposed solution

Describe alternatives you've considered

gegoune commented 4 months ago

A back button. Currently router.back() can navigate you to another site

Side note: I would never come back to your site ever again if it had behaviour like this (if I am understanding you correctly here). It's just not a nice practice.

AlexXanderGrib commented 4 months ago

A back button. Currently router.back() can navigate you to another site

Side note: I would never come back to your site ever again if it had behaviour like this (if I am understanding you correctly here). It's just not a nice practice.

No, you misunderstood, it's more app-like

You can be redirected from help article to /settings/security And it's more logical that back button redirects you to /settings, rather than to article you came from, especially if app is installed PWA

image

posva commented 4 months ago

You can already write to history.state with history.replacestate in a router.aftereach hook to have this feature