qwIm.js 479 B

1234567891011121314151617181920212223242526272829
  1. const state = {
  2. shareCourse: null,
  3. totalUnreadCount: 0
  4. }
  5. const mutations = {
  6. SHARE_COURSE: (state, data) => {
  7. state.shareCourse = data
  8. },
  9. TOTAL_UNREAD_COUNT: (state, data) => {
  10. state.totalUnreadCount = data
  11. }
  12. }
  13. const actions = {
  14. shareCourse({ commit }, data) {
  15. commit('SHARE_COURSE', data)
  16. },
  17. totalUnreadCount({ commit }, data) {
  18. commit('TOTAL_UNREAD_COUNT', data)
  19. }
  20. }
  21. export default {
  22. namespaced: true,
  23. state,
  24. mutations,
  25. actions
  26. }