Skip to content

⬅️ Back to Table of Contents

📄 useRouteParams

📊 Analysis Summary

Metric Count
🔧 Functions 3
📦 Imports 13
📊 Variables & Constants 1
🟢 Vue Composition API 1

📚 Table of Contents

🛠️ File Location:

📂 packages/router/useRouteParams/index.ts

📦 Imports

Name Source
MaybeRefOrGetter vue
Ref vue
LocationAsRelativeRaw vue-router
RouteParamValueRaw vue-router
Router vue-router
ReactiveRouteOptionsWithTransform ../_types
tryOnScopeDispose @vueuse/shared
customRef vue
nextTick vue
toValue vue
watch vue
useRoute vue-router
useRouter vue-router

Variables & Constants

Name Type Kind Value Exported
_queue WeakMap<Router, Map<string, any>> const new WeakMap<Router, Map<string, any>>()

Vue Composition API

Name Type Reactive Variables Composables
watch watch none none

Functions

useRouteParams(name: string): Ref<null | string | string[]>

Parameters:

  • name string

Returns: Ref<null | string | string[]>

Code
export function useRouteParams(
  name: string,
): Ref<null | string | string[]>

Internal helpers

Declared inside another function in this file.

transformGet(value: T): K

Parameters:

  • value T

Returns: K

Code
(value: T) => value as unknown as K

transformSet(value: K): T

Parameters:

  • value K

Returns: T

Code
(value: K) => value as unknown as T

Generated by Syntax Scribe