Open
Description
What problem does this feature solve?
I am trying to create a button within a router-link
that shows a loading indicator when clicked (but still allows opening in a new tab, which should not show a loading indicator).
It would be nice if navigate($event)
in the v-slot
API could return a promise when it performs a .push/replace()
so that I could stop the loading animation when the route fails to load, or succeeds, just like router.push/replace(to)
does.
Right now the only way to do this in my app is to implement a programmatic push or replace call, which does not allow opening in a new tab.
Thank you so much!
What does the proposed API look like?
navigate(e)
returns a Promise (the result of .push
or .replace
) if either of those functions are called within navigate(e)
. If neither is called, return nothing.