Extract variable

This commit is contained in:
Jan Bader 2022-01-23 21:15:33 +00:00
parent c2326060b3
commit 4f72751ed6

View File

@ -16,9 +16,10 @@ const store = createStore({
}, },
mutations: { mutations: {
initializeStore(state) { initializeStore(state) {
if(localStorage.getItem("store")){ let store = localStorage.getItem("store");
if(store){
this.replaceState( this.replaceState(
Object.assign(state, JSON.parse(localStorage.getItem("store"))) Object.assign(state, store)
); );
} }
}, },