vuejs / vuex

🗃️ Centralized State Management for Vue.js.
https://vuex.vuejs.org
MIT License
28.41k stars 9.57k forks source link

使用mudule,在一个模块中commit另一个模块的mutations报unknown local mutation type #2249

Open LiYanyan-a opened 4 months ago

LiYanyan-a commented 4 months ago

createStore代码: import getters from './getters' import modules from './modules' import { createStore } from 'vuex' const store = createStore({ getters, modules, })

export function setupStore(app) { app.use(store); } 被报找不到mutation type的模块代码 import * as R from 'ramda' import http from '@/utils/http'

export default { namespaced: true, state: {}, mutations: { SET_DATA (state, { name, data }) { state[name] = data }, DEL_DATA (state, { name }) { delete state[name] }, }, actions: { async get ({ commit, rootGetters }, { category, onFinally }) {

},

}, }