vue-cookie
A Vue.js plugin for manipulating cookies
Installation
Install through npm
npm install vue-cookie --save
Include in <body>
after loading Vue and it will automatically hook into Vue
<script src="/node_modules/vue-cookie/src/vue-cookie.js'"></script>
Or do it the cool way and load it in your main.js/app.js
var Vue = require('vue');
var VueCookie = require('vue-cookie');
Vue.use(VueCookie);
Usage
The plugin is available through this.$cookie
in components
Example
this.$cookie.set('test', 'Hello world!', 1);
this.$cookie.get('test');
this.$cookie.delete('test');
Thanks for using the plugin, I am happy to accept feedback/pull requests, don not forget to star if you like it!
Happy Coding! :D