摘要: 四个map方法的使用 mapState mapState方法:用于帮助我们映射 state 中的数据为计算属性 computed: { // 借助 mapState生成计算属性:t1、t2、t3(对象方法) ...mapState({t1: 't1', t2: 't2',t3: 't3'}) // 阅读全文
posted @ 2022-02-07 22:05 HuangBingQuan 阅读(128) 评论(0) 推荐(0) 编辑
摘要: getter的使用 概念:当 state 中的数据需要经过加工后在使用时,可以使用getters加工。 在 store.js 中追加 getters配置 ...... const getters = { bigSum(state) { return state.xxx * 10 } } // 创建并 阅读全文
posted @ 2022-02-07 18:31 HuangBingQuan 阅读(98) 评论(0) 推荐(0) 编辑