组件 -> commit -> mutation -> state -> 视图变化 -> 响应式
- Vuex工作流
- 组件 -> dispatch -> action
- dispatch -> type(actionType) -> 某一个action
- action -> commit 待用 -> mutation
- mutation -> change -> state
- render方案: state -> 数据流 -> 视图
- 文件集合
- actionTypes action类型
- actions 调用mutation的方法
- mutations 更改state的方法
- state **数据管理池
- store出口 actions、mutations、state统一到仓库里进行管理
组件划分
- TodoList
- TodoInput -> 输入组件
- TodoList -> 列表组件
- TodoItem -> 列表项
- 完成或未完成的选择 checkbox
- 删除该项 button
- 正在做的确认按钮 button