store 组织架构
store{
moudleA{
state:{}
mutation:{
##### 纯函数
}
getters{ 定义一些响应式属性类似于 computed }
action:{
#### 处理异步函数 例如登录注册
}
}
}
组件中调用
methods: {
...mapGetters([''getter的名字'']),
这样就就可以直接调用 对应的getter 了
...mapActions(['Login', 'Logout']),
这样就可以调用对应的action了
}
交互——》事件——》action——》mutation——》state——》v