Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)