mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
feat(nuxt): support passing options to useRequestURL
(#26687)
This commit is contained in:
parent
5695027a03
commit
0a1b72f9fd
@ -2,9 +2,9 @@ import { getRequestURL } from 'h3'
|
||||
import { useRequestEvent } from './ssr'
|
||||
|
||||
/** @since 3.5.0 */
|
||||
export function useRequestURL () {
|
||||
export function useRequestURL (opts?: Parameters<typeof getRequestURL>[1]) {
|
||||
if (import.meta.server) {
|
||||
return getRequestURL(useRequestEvent()!)
|
||||
return getRequestURL(useRequestEvent()!, opts)
|
||||
}
|
||||
return new URL(window.location.href)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user