0

I'm creating an app using Vue3\Capacitor\Ionic. The HomePage.vue displays a map and uses various other functionality. This works fine but is quite heavy to load so I don't want to refresh the whole page a lot. The scenario I've struggling with is this: A person receives an URL in a email for example:

www.example.com/warning/qwerty

qwerty is a quick access code from which a db dip returns some data. This data will then update the map. If I hardcode accesscode.value = 'qwerty' everything works as designed.
In my router index file I have:

{path: '/warning/:accesscode', component: HomePage},

This also works but it reloads the HomePage, which is the scenario I'm trying to avoid. Assuming that HomePage is already open, how can present the accesscode to the homepage via a url without refreshing the page?

Wyn
  • 97
  • 7
  • How would the HomePage be already open if the initiator is a link sent by email? – tao May 31 '23 at 15:20
  • They can be looking at the page and observing the map. The email arrives and they click on the link. – Wyn May 31 '23 at 16:51
  • The click on the link from email opens a new window/tab. It won't open into an existing tab/window. – tao May 31 '23 at 16:52
  • Look here: https://stackoverflow.com/a/28455084 to open in the same tab. But it will reload the page. – Gabe May 31 '23 at 17:46
  • The requested functionality is not technically possible using any mainstream browser. Even if you open the link in the same tab/window, the browser makes a clear separation between the old content and the new one, even if they're on the same domain. So no, what you are asking for is not possible. At the same time, it's possible to update an app's route without replacing the route component. Actually, that's the default behavior if `` does not have a `:key` or, if it has one, it doesn't change. – tao Jun 01 '23 at 10:47

0 Answers0