Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useBrowserLocation.md
1---2category: Browser3---45# useBrowserLocation67Reactive browser location89> NOTE: If you're using Vue Router, use [`useRoute`](https://router.vuejs.org/guide/advanced/composition-api.html) provided by Vue Router instead.1011## Usage1213```ts14import { useBrowserLocation } from '@vueuse/core'1516const location = useBrowserLocation()17```1819## Component Usage2021```vue22<UseBrowserLocation v-slot="location">23Browser Location: {{ location }}24</UseBrowserLocation>25```2627## Type Declarations2829```ts30export interface UseBrowserLocationOptions extends ConfigurableWindow {}31export interface BrowserLocationState {32readonly trigger: string33readonly state?: any34readonly length?: number35readonly origin?: string36hash?: string37host?: string38hostname?: string39href?: string40pathname?: string41port?: string42protocol?: string43search?: string44}45export type UseBrowserLocationReturn = Ref<BrowserLocationState>46/**47* Reactive browser location.48*49* @see https://vueuse.org/useBrowserLocation50*51* @__NO_SIDE_EFFECTS__52*/53export declare function useBrowserLocation(54options?: UseBrowserLocationOptions,55): UseBrowserLocationReturn56```57