...mapGetter的理解+ 对象展开运算符

import { mapGetters } from 'vuex'

export default {
  // ...
  computed: {
  // 使用对象展开运算符将 getter 混入 computed 对象中
    ...mapGetters([
      'doneTodosCount',
      'anotherGetter',
      // ...
    ])
  }
}
mapGetters 辅助函数仅仅是将 store 中的 getter 映射到局部计算属性:

https://blog.csdn.net/z9061/article/details/80958852

猜你喜欢

转载自blog.csdn.net/weixin_36869329/article/details/81779547
今日推荐