mirror of
https://github.com/marktext/marktext.git
synced 2025-05-16 08:50:42 +08:00
35 lines
625 B
JavaScript
35 lines
625 B
JavaScript
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
|
|
import editorStore from './editor'
|
|
import aidouStore from './aidou'
|
|
|
|
Vue.use(Vuex)
|
|
|
|
const storeArray = [
|
|
editorStore,
|
|
aidouStore
|
|
]
|
|
|
|
const { actions, mutations, state } = storeArray.reduce((acc, s) => {
|
|
const {actions, mutations, state} = s
|
|
return {
|
|
actions: Object.assign({}, acc.actions, actions),
|
|
mutations: Object.assign({}, acc.mutations, mutations),
|
|
state: Object.assign({}, acc.state, state)
|
|
}
|
|
}, {
|
|
actions: {},
|
|
mutations: {},
|
|
state: {}
|
|
})
|
|
|
|
const store = new Vuex.Store({
|
|
actions,
|
|
mutations,
|
|
state,
|
|
getters: {}
|
|
})
|
|
|
|
export default store
|