Giter Site home page Giter Site logo

biyuqi / vuex-save Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 93 KB

The plugins can save your Vuex data automatically. solve the problem of refreshing vuex data in the page =>自动存储vuex数据到本地,解决刷新页面vuex数据丢失的问题

Home Page: https://www.npmjs.com/package/vuex-save

License: MIT License

JavaScript 100.00%
vuex vuex-save vuex-plugin vuex-persistent-data vuex-persistent

vuex-save's Introduction

自动存储vuex数据到本地,解决刷新页面vuex数据丢失的问题 => (Automatically store vuex data to the local, solve the problem of refreshing vuex data in the page)

安装 (Installation)

npm install vuex-save -S

使用 (Usage)

import vuexSave from 'vuex-save'

// store.js
const store = new Vuex.Store({
  state,
  mutations,
  plugins: [vuexSave({
    // set save name and mode
    name: 'loadingmore_save_vuex',
    mode: 'localStorage'
  })]
  // or
  // plugins: [vuexSave({
  //  name: 'loadingmore_save_vuex',
  //  mode: 'sessionStorage'
  // })]
  // or default
  // plugins: [vuexSave()]
})

API

/**
 * @param {Object}
 * @param {name} String
 * @param {mode} String localStorage or sessionStorage
 */
{
  name: 'your local data name', // Default name ==> Save_Vuex_Static_Name
  mode: 'set the local data mode that you need' // Default mode ==> localStorage
}

Change LOG

1.2 version

  • 修复1.1版本不能自定义本地存储name的问题

TODO

// support save store single module

vuex-save's People

Contributors

biyuqi avatar

Stargazers

 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.