vuex原理

293 阅读1分钟

关键点:

  • 使用mixin在beforeCreate生命周期初始化vuex
  • 使用vue本身的响应式给state添加数据监听
  • 使用object.defineProperty给getter添加响应式

image.png