方诺官网改正版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 line
499 B

  1. import * as types from "./mutation-types";
  2. const state = () => {
  3. return {
  4. darkMode: false
  5. };
  6. };
  7. // getters
  8. const getters = {
  9. darkMode: state => state.darkMode
  10. };
  11. // actions
  12. const actions = {
  13. setDarkMode({ commit }, darkMode) {
  14. commit(types.SET_DARK_MODE, { darkMode });
  15. }
  16. };
  17. // mutations
  18. const mutations = {
  19. [types.SET_DARK_MODE](state, { darkMode }) {
  20. state.darkMode = darkMode;
  21. }
  22. };
  23. export default {
  24. namespaced: true,
  25. state,
  26. getters,
  27. actions,
  28. mutations
  29. };