コンテンツへスキップ

useRouteHash

カテゴリ
エクスポートサイズ
514 B
パッケージ
@vueuse/router
最終更新日
先週

リアクティブなroute.hashのショートハンドです。@vueuse/routerアドオンで使用できます。

使用方法

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>

ソース

ソースドキュメント

コントリビューター

Anthony Fu
Antério Vieira
Anthony Fu
Lindsay Gaines
Dvir Hazout
Curt Grimes

変更ログ

v12.0.0-beta.1 2024/11/21
0a9ed - feat!: Vue 2サポートの削除、バンドルの最適化、クリーンアップ (#4349)
v11.0.0-beta.3 2024/8/14
965bf - fix(useRouteHash, useRouteParams, useRouteQuery): エフェクトが複数回トリガーされる問題を修正 (#4113)
v10.3.0 2023/7/30
0d02f - fix(router): ルーター関数の改善: 値の同期、テストの追加、パフォーマンスの最適化 (#3184)
v10.2.0 2023/6/16
d5252 - fix(useRouteHash,useRouteQuery,useRouteParams): 値を即座に再評価 (#3002)
v9.4.0 2022/10/25
be36a - fix(useRouteHash, useRouteParams, useRouteQuery): 選択されたルートパラメータのみ上書き (#2350)

MITライセンスの下でリリースされています。