Question: how would you open a route in a new tab?

This issue has been tracked since 2022-05-18.

I want to route to a component in a new tab, how do I force that instead of replacing the current page?

EmilTholin wrote this answer on 2022-05-18

Hi @DeepBhat!

If I understand your question correctly, you should be able to use a regular anchor tag with the attribute target set to _blank.

<a target="_blank" href="/a-route">Open a route in a new tab</a>
DeepBhat wrote this answer on 2022-05-18

Apologies, I don't think I was clear. I meant if I could use Link to open a component in a new tab? For example <Link to="printers"> opening the Printers route in a new tab?

EmilTholin wrote this answer on 2022-05-18

I see. If you open a new tab there will be an entirely new history stack, so it will not matter if you open the new tab with a regular a tag or a Link component (if that were possible). It's simply a limitation of how browsers work, sadly.

More Details About Repo
Owner Name EmilTholin
Repo Name svelte-routing
Full Name EmilTholin/svelte-routing
Language JavaScript
Created Date 2017-11-28
Updated Date 2022-12-03
Star Count 1711
Watcher Count 21
Fork Count 151
Issue Count 59

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date