Skip to content
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

请教一个vuex的属性映射的写法的问题。 #1

Open
FEr-Charles opened this issue May 15, 2017 · 2 comments
Open

请教一个vuex的属性映射的写法的问题。 #1

FEr-Charles opened this issue May 15, 2017 · 2 comments

Comments

@FEr-Charles
Copy link

FEr-Charles commented May 15, 2017

能请教一个小问题吗?
我看到关于mapState/mapMutations这些的地方,你的写法都是跟文档不一样的。、

computed: {
    ...mapState({   //这些写法你是从何得知的呢?然后你可以跟我说一下为什么可以这样写吗?
      searchNews: state => state.SelectStore.searchNews
    })
  },

因为官方文档给出的事例是这样的

computed : mapState({
     searchNews: state => state.SelectStore.searchNews
})

另外你的mapMutations也都是这样写的。还望指点一下:

这些写法你是从何得知的呢?然后你可以跟我说一下为什么可以这样写吗?

@FEr-Charles
Copy link
Author

我已经解决了。文档看的不够好!

@daoket
Copy link
Owner

daoket commented May 16, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants