Skip to content

useBrowserLocation

反应式浏览器位置

¥Reactive browser location

注意:如果你使用的是 Vue Router,请改用 Vue Router 提供的 useRoute

¥NOTE: If you're using Vue Router, use useRoute provided by Vue Router instead.

示例

Input and hash will be changed:
trigger: load

用法

¥Usage

ts
import { 
useBrowserLocation
} from '@vueuse/core'
const
location
=
useBrowserLocation
()

组件用法

¥Component Usage

vue
<UseBrowserLocation v-slot="{ location }">
  Browser Location: {{ location }}
</UseBrowserLocation>