diveDylan / blog

My blog, detail is in the issues list
2 stars 0 forks source link

VueX #17

Open diveDylan opened 4 years ago

diveDylan commented 4 years ago

mutation

mutation 必须遵循vue的响应原则

  1. store中初始化所有属性
  2. 在对象中添加属性使用$set或者新对象代替老对象

mutation必须是同步

diveDylan commented 4 years ago

action

Action 提交的是 mutation,而不是直接变更状态。 Action 可以包含任意异步操作。