refactor: editor + discard edits + save -> vue components
This commit is contained in:
@@ -3,8 +3,10 @@ import Vuex from 'vuex'
|
||||
|
||||
import alert from './modules/alert'
|
||||
import anchor from './modules/anchor'
|
||||
import editor from './modules/editor'
|
||||
import modalCreatePage from './modules/modal-create-page'
|
||||
import modalCreateUser from './modules/modal-create-user'
|
||||
import modalDiscardPage from './modules/modal-discard-page'
|
||||
import modalMovePage from './modules/modal-move-page'
|
||||
import pageLoader from './modules/page-loader'
|
||||
|
||||
@@ -25,8 +27,10 @@ export default new Vuex.Store({
|
||||
modules: {
|
||||
alert,
|
||||
anchor,
|
||||
editor,
|
||||
modalCreatePage,
|
||||
modalCreateUser,
|
||||
modalDiscardPage,
|
||||
modalMovePage,
|
||||
pageLoader
|
||||
}
|
||||
|
9
client/js/store/modules/editor.js
Normal file
9
client/js/store/modules/editor.js
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {},
|
||||
getters: {},
|
||||
mutations: {},
|
||||
actions: {}
|
||||
}
|
16
client/js/store/modules/modal-discard-page.js
Normal file
16
client/js/store/modules/modal-discard-page.js
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
shown: false
|
||||
},
|
||||
getters: {},
|
||||
mutations: {
|
||||
shownChange: (state, shownState) => { state.shown = shownState }
|
||||
},
|
||||
actions: {
|
||||
open({ commit }) { commit('shownChange', true) },
|
||||
close({ commit }) { commit('shownChange', false) }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user