-
-
Notifications
You must be signed in to change notification settings - Fork 5k
[FEATURE] A url generation method that returns the compiled url for the given named route populated with the given params. #1430
New issue
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
Comments
You already have router.resolve: https://router.vuejs.org/en/api/router-instance.html |
@posva seems to be it (the name wasn't so clear IMHO resolve looks more like word used to resolve data in this lib, maybe rename to resolveUrl ?) could you tell what current?, append? params are for since it's not said on the docs |
beforeResolve this method for example entertains the confusion on the router.resolve method lol |
I agree that it's quite confusing, the resolve word is used a bit too much |
thanks ! |
What problem does this feature solve?
This feature will solve a simple problem, having urls in translations.
Today if i have a translation text that has anchors linking to some part of the website, i can't generate a url based on a named route.
"But you can just inject the url hardcoded" - well yes, but where's the point of having named routes if i can't generate my own url at some point to just have the "text value" of my url ?
Other use-case : a user has referral url he wants to share ton somebody, well i can't output the url to the user to copy / paste.
What does the proposed API look like?
e.g :
The text was updated successfully, but these errors were encountered: