mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(types): cookie options are optional
This commit is contained in:
parent
5fdefed39e
commit
c3b72a6ee2
@ -19,7 +19,7 @@ const CookieDefaults: CookieOptions<any> = {
|
|||||||
encode: val => encodeURIComponent(typeof val === 'string' ? val : JSON.stringify(val))
|
encode: val => encodeURIComponent(typeof val === 'string' ? val : JSON.stringify(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useCookie <T=string> (name: string, _opts: CookieOptions<T>): CookieRef<T> {
|
export function useCookie <T=string> (name: string, _opts?: CookieOptions<T>): CookieRef<T> {
|
||||||
const opts = { ...CookieDefaults, ..._opts }
|
const opts = { ...CookieDefaults, ..._opts }
|
||||||
const cookies = readRawCookies(opts)
|
const cookies = readRawCookies(opts)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user