Skip to content

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>

源代码

源代码文档

变更日志

No recent changes

VueUse 中文网 - 粤ICP备13048890号