Modularized store

This commit is contained in:
portree_kid
2019-12-22 18:27:21 +01:00
parent 791ec7ae24
commit 40df1f1202
3 changed files with 19 additions and 35 deletions
+10 -11
View File
@@ -1,25 +1,24 @@
import createPersistedState from 'vuex-persistedstate'
const state = {
flightgearPath: ''
settings: { flightgearDirectory: '.' }
}
const mutations = {
DECREMENT_MAIN_COUNTER (state) {
state.main--
},
INCREMENT_MAIN_COUNTER (state) {
state.main++
'DELETE_INDEXED_DB' () { },
'SETTINGS_DIRECTORY' (state, flightgearDirectory) {
state.settings.flightgearDirectory = flightgearDirectory
}
}
const plugins = [createPersistedState()]
const actions = {
someAsyncTask ({ commit }) {
// do something async
commit('INCREMENT_MAIN_COUNTER')
}
}
export default {
state,
mutations,
actions
actions,
plugins
}