摘要:
四个map方法的使用 **mapState方法:**用于帮助我们映射state中的数据为计算属性 computed: { //借助mapState生成计算属性: sum、school、subject(对象写法) ...mapState({sum:'sum',school:'school',subje 阅读全文
摘要:
getters的使用 1.概念:当state中的数据需要经过加工后再使用时,可以使用getters加工。 2.在store.js 中追加getters配置 ...... const getters = { bigSum(state){ return state.sum*10 } } //创建并暴露s 阅读全文