mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
fix(nuxt3): use resolved options for useCookie
(#2260)
This commit is contained in:
parent
1ef6e3f525
commit
6a25d3e245
@ -25,7 +25,7 @@ export function useCookie <T=string> (name: string, _opts?: CookieOptions<T>): C
|
||||
const opts = { ...CookieDefaults, ..._opts }
|
||||
const cookies = readRawCookies(opts)
|
||||
|
||||
const cookie = ref(cookies[name] ?? _opts.default?.())
|
||||
const cookie = ref(cookies[name] ?? opts.default?.())
|
||||
|
||||
if (process.client) {
|
||||
watch(cookie, () => { writeClientCookie(name, cookie.value, opts as CookieSerializeOptions) })
|
||||
|
Loading…
Reference in New Issue
Block a user