1. vuejs-localstorage

vuejs-localstorage

vue-local-storage

local storage fro vue2.x

Install

you can install it via npm:
npm install --save vue-local-storage

Usage

import Vue from 'vue';
import VueLocalStorage from 'vue-local-storage';
Vue.use(VueLocalStorage);

//the brower is support? it will return true or false;
this.$ls.isSupport;  

//set
this.$ls.set('my_key',{ 'firstName':'guan', 'lastName':'mac'});

//get
this.$ls.get('my_key');
// result: { "firstName":"guan", "lastName":"mac"}

//delete a key 
this.$ls.del('my_key');

//get local storage length
this.$ls.length;

// clear all data
this.$ls.clear();

License

MIT

Dependencies