Skip to content

mapGetters 辅助函数,将一个 getter 属性另取一个名字 #1452

@dinglittle

Description

@dinglittle

Version

3.0.1

Reproduction link

https://vuex.vuejs.org/zh/guide/getters.html

Steps to reproduce

Vuex 官方 链接所示 mapGetters 辅助函数,将一个 getter 属性另取一个名字 , 示例代码

What is expected?

mapGetters({
  // 把 `this.doneCount` 映射为 `this.$store.getters.doneTodosCount`
  doneCount: 'doneTodosCount'
})

What is actually happening?

修正

...mapGetters({
  // 把 `this.doneCount` 映射为 `this.$store.getters.doneTodosCount`
  doneCount: 'doneTodosCount'
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions