Skip to content

Function: useRouteState() ​

ts
function useRouteState<P, M>(options): Ref<InferInputValue<P, UnwrapOption<M>>, InferInputWritable<P, UnwrapOption<M>>>;

Defined in: router/use-route-state.ts:35

Keeps one value in the URL and returns a ref over it. Needs vue-router.

Type Parameters ​

Type ParameterDefault type
P extends ParserInput | undefinedundefined
Mnull

Parameters ​

ParameterType
optionsUseRouteStateOptions<P, M>

Returns ​

Ref<InferInputValue<P, UnwrapOption<M>>, InferInputWritable<P, UnwrapOption<M>>>

Released under the MIT License.