index.js 528 B

12345678910111213141516171819202122232425262728
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './modules/user'
  4. import notifyService from "@/api/notify/notifyService";
  5. Vue.use(Vuex)
  6. export default new Vuex.Store({
  7. modules: {
  8. user
  9. },
  10. state: {
  11. messageDataList: []
  12. },
  13. mutations: {
  14. setMessageDataList(state, dataList) {
  15. state.messageDataList = dataList;
  16. }
  17. },
  18. actions: {
  19. async loadmore({ commit }) {
  20. const data = await notifyService.getUnreadCountByIsSelf({
  21. isSelf: true
  22. });
  23. return data; // 返回数据,如果需要
  24. }
  25. }
  26. })