Skip to content

⬅️ Back to Table of Contents

📄 index.ts

📊 Analysis Summary

Metric Count
🔧 Functions 3
📦 Imports 13
📊 Variables & Constants 4
🟢 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>>()
_paramsQueue Map<string, any> const _queue.get(router)!
param any let/var route.params[name] as any
_trigger () => void let/var *not shown*

Vue Composition API

Name Type Reactive Variables Composables
watch watch none none

Functions

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

Code
export function useRouteParams(
  name: string
): Ref<null | string | string[]>
  • Parameters:
  • name: string
  • Return Type: Ref<null | string | string[]>

transformGet(value: T): K

Code
(value: T) => value as unknown as K
  • Parameters:
  • value: T
  • Return Type: K

transformSet(value: K): T

Code
(value: K) => value as unknown as T
  • Parameters:
  • value: K
  • Return Type: T