New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

dinglittle opened this Issue Nov 20, 2018 · 1 comment


None yet
2 participants

dinglittle commented Nov 20, 2018



Reproduction link

Steps to reproduce

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

What is expected?

  // 把 `this.doneCount` 映射为 `this.$store.getters.doneTodosCount`
  doneCount: 'doneTodosCount'

What is actually happening?


  // 把 `this.doneCount` 映射为 `this.$store.getters.doneTodosCount`
  doneCount: 'doneTodosCount'

This comment has been minimized.


ktsn commented Dec 2, 2018

The example code does not need to have object spread operator since it just shows the example of its argument.
In fact, there are some cases we can use it without object spread operator:

export default {
  computed: mapGetters({
    doneCount: 'doneTodosCount'

@ktsn ktsn closed this Dec 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment