v-localstorage

1.0.5 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i v-localstorage

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

4.63 kB

Total Files

5

Last publish

Collaborators

  • guanmac