|
@@ -83,6 +83,7 @@ import { createNamespacedHelpers, mapState } from 'vuex'
|
83
|
83
|
const {
|
84
|
84
|
mapState: mapLibSate,
|
85
|
85
|
mapActions,
|
|
86
|
+ mapMutations,
|
86
|
87
|
} = createNamespacedHelpers('library')
|
87
|
88
|
|
88
|
89
|
export default {
|
|
@@ -114,7 +115,14 @@ export default {
|
114
|
115
|
},
|
115
|
116
|
},
|
116
|
117
|
},
|
|
118
|
+ beforeRouteLeave (to, from, next) {
|
|
119
|
+ this.resetStore('list')
|
|
120
|
+ next()
|
|
121
|
+ },
|
117
|
122
|
methods: {
|
|
123
|
+ ...mapMutations({
|
|
124
|
+ resetStore: 'clearData',
|
|
125
|
+ }),
|
118
|
126
|
...mapActions({
|
119
|
127
|
getBorrowHistory: 'getBorrowHistory',
|
120
|
128
|
getList: 'getBookList',
|