1.0.0 • Published 7 years ago

vuejs-localstorage v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

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

1.0.1

7 years ago

1.0.0

7 years ago