refactor: vue fixes + modal-upgrade-system.vue
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
shown: false,
|
||||
hash: ''
|
||||
@@ -13,10 +14,11 @@ export default {
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
anchorOpen({ commit, dispatch }, hash) {
|
||||
open({ commit }, hash) {
|
||||
console.info('MIGUEL!')
|
||||
commit('anchorChange', { shown: true, hash })
|
||||
},
|
||||
anchorClose({ commit, dispatch }) {
|
||||
close({ commit }) {
|
||||
commit('anchorChange', { shown: false })
|
||||
}
|
||||
}
|
||||
|
24
client/js/store/modules/modal-upgrade-system.js
Normal file
24
client/js/store/modules/modal-upgrade-system.js
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
shown: false,
|
||||
mode: 'upgrade',
|
||||
step: 'confirm'
|
||||
},
|
||||
getters: {},
|
||||
mutations: {
|
||||
shownChange: (state, shownState) => { state.shown = shownState },
|
||||
modeChange: (state, modeState) => { state.mode = modeState },
|
||||
stepChange: (state, stepState) => { state.step = stepState }
|
||||
},
|
||||
actions: {
|
||||
open({ commit }, opts) {
|
||||
commit('shownChange', true)
|
||||
commit('modeChange', opts.mode)
|
||||
commit('stepChange', 'confirm')
|
||||
},
|
||||
close({ commit }) { commit('shownChange', false) }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user