vue-cli-plugin-cookie
🍪 Vue CLI 3/4 Plugin for handling browser cookies
Install
add the cookie plugin with vue-cli or vue-cli UI. import
and .use()
will be added to main.js automatically
vue add cookie
Example Usage
Get a cookie
this$cookie
Set a cookie
this$cookiethis$cookie // set SameSite to Lax, Expires to 1 yearthis$cookiethis$cookiethis$cookiethis$cookiethis$cookiethis$cookie
Remove a cookie on the current domain
this$cookiethis$cookie // alias of removethis$cookie // remove the parent domain's cookie
Get all cookies
this$cookie