- foo=bar
- vueuse=awesome
useUrlSearchParams
Reactive URLSearchParams
Usage
<template>
<ul>
<li v-for='key in Object.keys(params)' :key="key">
{ key }}={{ params[key] }}
</li>
</ul>
</template>
<script>
import { useUrlSearchParams } from '@vueuse/core'
export default {
setup() {
const params = useUrlSearchParams('history')
params.foo = 'bar'
params.vueuse = 'awesome'
return { params }
}
}
</script>
Type Declarations
export declare type UrlParams = Record<string, string[] | string>
/**
* Reactive URLSearchParams
*
* @see /useUrlSearchParams
* @param mode
* @param options
*/
export declare function useUrlSearchParams<
T extends Record<string, any> = UrlParams
>(mode?: "history" | "hash", options?: ConfigurableWindow): T