主题
useRouteHash
反应式 route.hash
的简写。
¥Shorthand for a reactive route.hash
. Available in the @vueuse/router add-on.
用法
¥Usage
ts
import { useRouteHash } from '@vueuse/router'
const search = useRouteHash()
console.log(search.value) // route.hash
search.value = 'foobar' // router.replace({ hash: 'foobar' })
类型声明
typescript
export declare function useRouteHash(
defaultValue?: MaybeRefOrGetter<RouteHashValueRaw>,
{ mode, route, router }?: ReactiveRouteOptions,
): Ref<RouteHashValueRaw, RouteHashValueRaw>