import Vue from 'vue' import Vuex from 'vuex' import user from './modules/user' import notifyService from "@/api/notify/notifyService"; Vue.use(Vuex) export default new Vuex.Store({ modules: { user }, state: { messageDataList: [] }, mutations: { setMessageDataList(state, dataList) { state.messageDataList = dataList; } }, actions: { async loadmore({ commit }) { const data = await notifyService.getUnreadCountByIsSelf({ isSelf: true }); return data; // 返回数据,如果需要 } } })