import type { ComputedRef } from 'vue' export function useRouteParam(name: string, init?: T): ComputedRef { const route = useRoute() return computed(() => route.params[name] as any ?? init) }