forked from AkkomaGang/admin-fe
Clear search and filter inputs when vue instance is destroyed
This commit is contained in:
parent
1c2782a522
commit
20a56bb21f
2 changed files with 7 additions and 0 deletions
|
@ -124,6 +124,10 @@ const users = {
|
||||||
|
|
||||||
dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId })
|
dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId })
|
||||||
},
|
},
|
||||||
|
ClearUsersState({ commit }) {
|
||||||
|
commit('SET_SEARCH_QUERY', '')
|
||||||
|
commit('SET_USERS_FILTERS', { local: false, external: false, active: false, deactivated: false })
|
||||||
|
},
|
||||||
async ClearFilters({ commit, dispatch, state }) {
|
async ClearFilters({ commit, dispatch, state }) {
|
||||||
commit('CLEAR_USERS_FILTERS')
|
commit('CLEAR_USERS_FILTERS')
|
||||||
dispatch('SearchUsers', { query: state.searchQuery, page: 1 })
|
dispatch('SearchUsers', { query: state.searchQuery, page: 1 })
|
||||||
|
|
|
@ -179,6 +179,9 @@ export default {
|
||||||
this.$store.dispatch('NeedReboot')
|
this.$store.dispatch('NeedReboot')
|
||||||
this.$store.dispatch('FetchUsers', { page: 1 })
|
this.$store.dispatch('FetchUsers', { page: 1 })
|
||||||
},
|
},
|
||||||
|
destroyed() {
|
||||||
|
this.$store.dispatch('ClearUsersState')
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
activationIcon(status) {
|
activationIcon(status) {
|
||||||
return status ? 'el-icon-error' : 'el-icon-success'
|
return status ? 'el-icon-error' : 'el-icon-success'
|
||||||
|
|
Loading…
Reference in a new issue