router.urlForName method
Vaadin Router supports referring to routes using string names. You can
assign a name to a route using the name property of a route
object, then generate URLs for that route using the
router.urlForName(name, parameters)
helper instance method.
Arguments:
name — the route nameparameters — optional object with parameters for
substitution in the route path
If the component property is specified on the route object,
the name property could be omitted. In that case,
the component name could be used in the router.urlForName().
router.urlForPath method
router.urlForPath(path, parameters)
is a helper method that generates a URL for
the given route path, optionally performing substitution of parameters.
Arguments:
path — a string route path defined in express.js syntaxparameters — optional object with parameters for
path substitutionlocation.getUrl method
location.getUrl(params)
is a method that returns a URL corresponding to the location.
When given the params argument, it does parameter substitution
in the location’s chain of routes.
Arguments:
params — optional object with parameters to override
the location parametersWhen base URL is set, the URL generation helpers return absolute pathnames, including the base.
At the moment, Vaadin Router does not provide URL generation APIs for appending search query parameters or hash strings to the generated URLs. However, you could append those with string concatenation.
For serialising parameters into a query string, use the native
URLSearchParams API.
Note: The URLSearchParams API is absent in IE 11, make sure
to have the URLSearchParams polyfill.