How to use vue-warehouse - 1 common examples

To help you get started, we’ve selected a few vue-warehouse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bazzite / vue-warehouse / examples / vuex-synchronization / app.js View on Github external
import Vuex from 'vuex'
import VueWarehouse from 'vue-warehouse'
import VueWarehouseSync from 'vue-warehouse/sync'

import VueWarehouseStore from 'store' // vue-warehouse store instance

console.log(process.env.NODE_ENV)

Vue.use(Vuex)
Vue.use(VueWarehouse, {
  store: VueWarehouseStore
})

const VuexStore = new Vuex.Store()

VueWarehouseSync(VuexStore, VueWarehouseStore)

new Vue({
  store: VuexStore,
  data: {
    saveFormInputDataKey: 'name',
    saveFormInputDataValue: 'Jhon Doe',
    showAlertMessage: false
  },
  methods: {
    save: function () {
      this.$warehouse.set(this.saveFormInputDataKey, this.saveFormInputDataValue)

      this.showAlertMessage = true
    },
    remove: function () {
      this.$warehouse.remove(this.saveFormInputDataKey)

vue-warehouse

A Cross-browser storage for Vue.js and Nuxt.js, with plugins support and easy extensibility based on Store.js

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular vue-warehouse functions