Extract variable
This commit is contained in:
parent
c2326060b3
commit
4f72751ed6
@ -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)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user