Skip to content

Commit cea74fe

Browse files
committed
Add vuex-persistedstate package to save user data to local storage permanently
1 parent f1766ef commit cea74fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"core-js": "^3.8.3",
1212
"vue": "^3.4.15",
1313
"vue-ellipse-progress": "^2.1.2",
14-
"vuex": "^4.1.0"
14+
"vuex": "^4.1.0",
15+
"vuex-persistedstate": "^4.1.0"
1516
},
1617
"devDependencies": {
1718
"@typescript-eslint/eslint-plugin": "^5.4.0",

src/store/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createStore } from "vuex";
2+
import createPersistedState from "vuex-persistedstate";
23

34
export default createStore({
45
state: {
@@ -275,4 +276,5 @@ export default createStore({
275276
},
276277
},
277278
modules: {},
279+
plugins: [createPersistedState()], //create persisted state and save the data to local storage
278280
});

0 commit comments

Comments
 (0)