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