Vue WStorage
Introduction
Vue WStorage is a library to manage localStorage and sessionStorage of your browser.
Install
npm install vue-wstorage --save
or
yarn add vue-wstorage
Install
Vue// Or you can specify any other name and use it via this.$ls, this.$whatEverYouWantVue
Usage
- Global instance
// Use localStorage from objectVuestorageVuestorage // Get all valuesVuestorage// Fallback value if nothing found in localStorageVuestorage // Will return 'fallbackValue' string // Remove valueVuestorage// Remove all valuesVuestorage
- Local instance
const storage = VueWStoragestoragestorage storagelocalstoragesession
- Component
var vm =methods:{this$storagethis$storagethis$storage}
License
MIT Licensed | Copyright © 2019-present Waavi Studio S.L.