A websocket based remote event system for Vue.js.
Works with Vue 2.0
, untested with Vue 1.0
.
npm install vue-storage
import Vue from 'vue';
import VueStorage from 'vue-storage';
Vue.use(
VueStorage
)
or
window.Vue = require('vue');
const VueStorage = require('vue-storage');
Vue.use(
VueStorage
)
This plugin provides a direct interface into the data storage client abstracting localStorage or browser cookies.
This plugin provides a mixin object storage
which allows for an attachment of data values to the storage class pulling storage values on creation and watching for changes.
...
Vue.Storage.setItem(name, value);
new Vue({
data: {
value: "defaultValue"
},
storage: {
"value"
}
})
...
If defaultValue
is not set it will return null if name
is not in storage.
...
Vue.Storage.getItem(name, defaultValue);
...