quanyawei
2024-05-13 1ee177908aaf4cf2474384503404cd238036596c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { Module, MutationTree, ActionTree, GetterTree } from 'vuex';
import { RootState } from './../store';
 
export interface Doctitle {
  title?: string;
  i18n?: string;
}
 
export interface IAppState {
  isCollapse: boolean ;
  name?: string;
  doctitle?: Doctitle;
}
 
 
const mutations: MutationTree<IAppState> = {
  collapse(state: IAppState) {
    state.isCollapse = !state.isCollapse;
  },
  appName(state: IAppState, appinfo: any) {
    state.name = appinfo.name;
  },
  changeTitle(state: IAppState, titleInfo: any) {
    state.doctitle = {
      ...titleInfo,
    };
  },
};
 
 
const actions: ActionTree<IAppState, RootState> = {
 
};
 
const getters: GetterTree<IAppState, RootState> = {
 
};
 
const appState: IAppState = {
  isCollapse: false,
  name: '',
  doctitle: {
    title: '',
  },
};
 
const app: Module<IAppState, RootState> = {
  namespaced: true,
  state: appState,
  getters,
  actions,
  mutations,
};
/*
const app = {
    namespaced: true,
    state: {
      isCollapse: false,
      name: '',
      doctitle: {
        title: '',
        i18n: null,
      },
    },
    mutations: {
      collapse(state: any) {
        state.isCollapse = !state.isCollapse;
      },
      setApp(state: any, appinfo: any) {
        state.name = appinfo.name;
      },
      changeTitle(state: any, titleInfo: any) {
        state.doctitle = {
          ...titleInfo,
        };
      },
    },
    actions: {
    },
  };
*/
 
export default app;