摘要: 3.mutations状态更新(mutations中的方法都是同步的) vuex的store状态的更新唯一方式:提交mutation mutation主要包括两部分:字符串的事件类型(type) 一个回调函数(handler),该回调函数的第一个参数就是state mutation的定义方式 通过m 阅读全文
posted @ 2020-03-20 17:05 天空003 阅读(989) 评论(0) 推荐(0) 编辑
摘要: 1.State单一状态树(Single Source Of Truth) state中存放状态相关的信息 一个项目中只建一个store,所以通过 this.$store.state.属性名 的时候总能找到那个唯一的数据 2.Getters 将state中的数据经过某种变化 栗子:1.vuex中的ge 阅读全文
posted @ 2020-03-20 14:54 天空003 阅读(2190) 评论(0) 推荐(0) 编辑