Component that allows you to manage multiple route param and query values.
For example, for URL https://yourweb.com/user/adrianhurt/friends?page=2, having a the route config { path: '/user/:username/friends' }, you will be able to easily manage the usernameroute param value and pageroute query value.
Object where each key is the a name of a managed value you want and its value is an OPTIONS object that determines its configuration and behaviour.
keepsQuery
Boolean
true
true if you want to keep any previous route query param into the new navigation. It's used only as a fallback if the corresponding value's keepsQuery is not present.
affectsHistory
Boolean
false
true if you want to use $router.push. false for $router.replace. It's used only as a fallback if the corresponding value's keepsQuery is not present.
navigationInterceptor(params)
Function
undefined
It's called when a new navigation should be place instead of using the default behaviour. The params is an object with { router, route, name, newValue, encodedValue, options } where in options appears all the component's props. It's used only as a fallback if the corresponding value's keepsQuery is not present.
disabled
Boolean
false
true for disable any value mutation.
optsByName is an object to declare every value you want to manage. Each key is the name of the value you want to manage and its value is an OPTIONS object that determines its configuration and behaviour.
As you can see, the OPTIONS object is very similar than the regular props of RouteParamValue and RouteQueryValue.
OPTIONS fields
Type
Default
Description
where
String
"query"
It could be "params" or "query".
urlName
String
key's name
The name of the route param or query param within URL. By default it uses the corresponding key's name (i.e. the param's name).
defaultValue
any
undefined
The default value. If current value is equal to defaultValue it will be removed from the URL.
type
String
string
The value's type to automatically encode/decode from string. The possible values are "string", "number" or "boolean".
encode(value)
Function
undefined
The encode funtion from the route string value (Any => String). If it's present the type prop is ignored.
decode(stringValue)
Function
undefined
The decode funtion from the route string value (String => Any). If it's present the type prop is ignored.
keepsQuery
Boolean
false
true if you want to keep any previous route query param into the new navigation.
affectsHistory
Boolean
true
true if you want to use $router.push. false for $router.replace.
navigationInterceptor(params)
Function
undefined
It's called when a new navigation should be place instead of using the default behaviour. The params is an object with { router, route, name, newValue, encodedValue, options } where in options appears all the component's props.