We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When click a link and before route to the target, it would be nice to have a global onBefore function or a onBefore on each route (or both).
E.g. if a page has modified fields, you can ask in a modal to save before leaving the page.
Currently you must implement it on your own on each link
<script> function beforeSwitch() { if (isModified && alert('Leave?')) { const url = new URL(this.href) push(url.hash.substr(1)) // remove # and route to target } } </script> <a href="#/target" on:click|preventDefault={beforeSwitch}>Link</a>
The text was updated successfully, but these errors were encountered:
This is great timing :) I created #40 as a draft last night and would be great if you could provide feedback on that design.
(Closing as duplicate of #23 and #40)
Sorry, something went wrong.
Route pre-conditions and routeLoaded event (#40)
943c339
Fixes #23 #43
Route pre-conditions and routeLoaded event (ItalyPaleAle#40)
34210dc
Fixes ItalyPaleAle#23 ItalyPaleAle#43
No branches or pull requests
When click a link and before route to the target, it would be nice to have a global onBefore function or a onBefore on each route (or both).
E.g. if a page has modified fields, you can ask in a modal to save before leaving the page.
Currently you must implement it on your own on each link
The text was updated successfully, but these errors were encountered: