Closed abensur closed 6 years ago
You could register the plugin multiple times with different keys / paths I guess?
Worked for me @robinvdvleuten !
import Vue from "vue";
import Vuex from "vuex";
import * as modules from "@/store/modules";
import appState from "vuex-persistedstate";
import versionState from "vuex-persistedstate";
import {
name,
version
} from "../../package";
Vue.use(Vuex);
const appKey = `${name}`;
const versionKey = `${name}@${version}`;
const store = new Vuex.Store({
strict: true,
modules,
plugins: [
versionState({
key: versionKey,
paths: [
"auth",
"auth.token",
"auth.store_id",
"auth.store_details"
]
}),
appState({
key: appKey,
paths: [
"store.ignore_list",
"store.customers_to_analyze"
]
})
]
});
export default store;
@abensur you don't have to import the plugin multiple times;
import Vue from "vue";
import Vuex from "vuex";
import * as modules from "@/store/modules";
import persistedState from "vuex-persistedstate";
import {
name,
version
} from "../../package";
Vue.use(Vuex);
const appKey = `${name}`;
const versionKey = `${name}@${version}`;
const store = new Vuex.Store({
strict: true,
modules,
plugins: [
persistedState({
key: versionKey,
paths: [
"auth",
"auth.token",
"auth.store_id",
"auth.store_details"
]
}),
persistedState({
key: appKey,
paths: [
"store.ignore_list",
"store.customers_to_analyze"
]
})
]
});
export default store;
ahh silly me, thanks!
Feature
Is it possible to make something like multiple keys?