useRouteParam.js 125 B

1234
  1. export function useRouteParam(name, init) {
  2. const route = useRoute()
  3. return computed(() => route.params[name] ?? init)
  4. }