mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +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 opts = { ...CookieDefaults, ..._opts }
|
||||||
const cookies = readRawCookies(opts)
|
const cookies = readRawCookies(opts)
|
||||||
|
|
||||||
const cookie = ref(cookies[name] ?? _opts.default?.())
|
const cookie = ref(cookies[name] ?? opts.default?.())
|
||||||
|
|
||||||
if (process.client) {
|
if (process.client) {
|
||||||
watch(cookie, () => { writeClientCookie(name, cookie.value, opts as CookieSerializeOptions) })
|
watch(cookie, () => { writeClientCookie(name, cookie.value, opts as CookieSerializeOptions) })
|
||||||
|
Loading…
Reference in New Issue
Block a user