@headbright/hb-universal-storage
v1.0.1
Published
A universal storage library for Nuxt projects with IE and Safari 10 support.
Downloads
76
Readme
Universal Storage Helper
Universal storage helper for Nuxt projects with tweaks to facilitate use with older browsers.
The project is based on the equivalent nuxt community module.
Installation
npm i --save @headbright/hb-universal-storage
Create a nuxt plugin:
import Storage from 'hb-universal-storage'
export default function(ctx, inject) {
const options = {
vuex: {
namespace: 'storage'
},
cookie: {
prefix: '',
options: {
path: '/'
}
},
localStorage: {
prefix: ''
},
ignoreExceptions: false
}
const storage = new Storage(ctx, options)
ctx.$storage = storage
inject('storage', storage)
}