1.0.5 • Published 4 years ago

v-localstorage v1.0.5

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

vue-local-storage

local storage fro vue2.x

Install

you can install it via npm: npm install --save v-localstorage

Usage

import Vue from 'vue';
import VueLocalStorage from 'v-localstorage';
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.5

4 years ago

1.0.3

7 years ago