Merge remote-tracking branch 'origin/master'
Showing
2 changed files
with
16 additions
and
4 deletions
1 | <template> | 1 | <template> |
2 | <div id="app"> | 2 | <div id="app"> |
3 | <router-view/> | 3 | <router-view /> |
4 | </div> | 4 | </div> |
5 | </template> | 5 | </template> |
6 | 6 | ||
7 | <script> | ||
8 | export default { | ||
9 | mounted() { | ||
10 | window.addEventListener("unload", this.saveState); | ||
11 | }, | ||
12 | methods: { | ||
13 | saveState() { | ||
14 | sessionStorage.setItem("state", JSON.stringify(this.$store.state)); | ||
15 | }, | ||
16 | }, | ||
17 | }; | ||
18 | </script> | ... | ... |
... | @@ -8,7 +8,7 @@ import setTabs from './modules/setTabs' | ... | @@ -8,7 +8,7 @@ import setTabs from './modules/setTabs' |
8 | Vue.use(Vuex) | 8 | Vue.use(Vuex) |
9 | 9 | ||
10 | const store = new Vuex.Store({ | 10 | const store = new Vuex.Store({ |
11 | state: { | 11 | state: sessionStorage.getItem('state') ? JSON.parse(sessionStorage.getItem('state')): { |
12 | zdbsm:'', | 12 | zdbsm:'', |
13 | xzqList:[], | 13 | xzqList:[], |
14 | djqList:[], | 14 | djqList:[], | ... | ... |
-
Please register or sign in to post a comment