vue | vue set localstorage
LocalStorageplugininspiredbyVuetypedpropswhichtakeacareoftypecastingforVue.js1and2withSSRsupport.Installnpm install vue-localstorage --saveorbower install vue-localstorageUsageimport VueLocalStorage from vue-localstorage Vue.use(VueLocalStorage)Vue.use(VueLocalStorage, { name: ls, bind: true }) Vue.localStorage.set(someNumber, 123)Vue.localStorage.get(someNumber) Vue.localStorage.get(propertyThatNotExists, fallbackValue) Vue.localStorage.get(property, null, Number) var vm = new Vue({ loc...
LocalStorage plugin inspired by Vue typed props which take a care of typecasting for Vue.js 1 and 2 with SSR support.
Installnpm install vue-localstorage --save
or
bower install vue-localstorage
Usageimport VueLocalStorage from vue-localstorage
Vue.use(VueLocalStorage)
Vue.use(VueLocalStorage, {
name: ls,
bind: true
})
Vue.localStorage.set(someNumber, 123)
Vue.localStorage.get(someNumber)
Vue.localStorage.get(propertyThatNotExists, fallbackValue)
Vue.localStorage.get(property, null, Number)
var vm = new Vue({
localStorage: {
someObject: {
type: Object,
default: {
hello: world
}
},
someNumber: {
type: Number,
},
someBoolean: {
type: Boolean
},
stringOne: ,
stringTwo: {
t...