Git Product home page Git Product logo

vue-storage's Introduction

vue-storage

A websocket based remote event system for Vue.js.

Works with Vue 2.0, untested with Vue 1.0.

Installation

1.) Install package via NPM
npm install vue-storage
2.) Activate plugin within project.
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
)

Usage

The Vue.Storage global object.

This plugin provides a direct interface into the data storage client abstracting localStorage or browser cookies.

The storage component object

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.

Storing Data elements

...
    Vue.Storage.setItem(name, value);

    new Vue({
        data: {
            value: "defaultValue"
        },
        storage: {
            "value"
        }
    })
...

Retrieving Data elements

If defaultValue is not set it will return null if name is not in storage.

...
    Vue.Storage.getItem(name, defaultValue);
...

License

MIT

vue-storage's People

Contributors

macarthurjustin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.