Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeCookie doesn't work in composition API #14

Open
greendrake opened this issue May 2, 2022 · 1 comment
Open

removeCookie doesn't work in composition API #14

greendrake opened this issue May 2, 2022 · 1 comment

Comments

@greendrake
Copy link

There is no this inside the removeCookie method when using the composition API (it is used to call isCookieAvailable).

@JCCorreale
Copy link

for others who may face this issue, here's a (ugly) workaround

import { useCookie } from 'vue-cookie-next'
const { removeCookie, isCookieAvailable } = useCookie()
...
// removeCookie("USER_ID") TypeError: Cannot read properties of undefined (reading 'isCookieAvailable')
removeCookie.bind({ isCookieAvailable: isCookieAvailable})("USER_ID")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants