1.state
在组件的 computed 中引用store中的值:
2.getter
1.store 中的 getters :相当于是组件中的 computed(对已有的变量的操作)
2.在组件的 computed 中引用getters中的值
3.mutation
1.store 中定义 mutations 方法(是对 state 的操作)
2.在组件的 methods 中调用 mutations 方法
3.使用常量替代 mutation 事件类型 —— 为了避免通过字符串引入方法时出错(常量的使用可以进行语法提示)
4.action
1.store 中定义actions(异步操作)
2.在组件的 methods 中调用 actions