Closed zhangjingl02 closed 8 years ago
actionsA.js
export const progress = ({ commit }, num) => { commit(types.GLOBAL_PROGRESS, num) }
actionsB.js
export const getData = ({ commit }) => { console.log('getData') }
store.js
import * as actionsA from 'actionA.js' import * as actionsB from 'actionB.js' export default new Vuex.Store({ /**在这里怎么同时把actionsA actionsB,作为Actions选项导入进来 **/ actions:[actionsA,actionsB], /**? modules: { xxx } })
补充下使用的是 vue2.0 + vuex2.0
你好,请使用论坛或gitter提问,issue列表只用于提交bug和feature request,谢谢!
用ES6对象展开(Object rest spread) actions:[...actionsA, ...actionsB] https://babeljs.io/docs/plugins/transform-object-rest-spread/
actions:[...actionsA, ...actionsB]
actionsA.js
actionsB.js
store.js