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

mapMutations and mapActions not usable in mixin #1659

Closed
SunGuoQiang123 opened this issue Dec 25, 2019 · 1 comment
Closed

mapMutations and mapActions not usable in mixin #1659

SunGuoQiang123 opened this issue Dec 25, 2019 · 1 comment

Comments

@SunGuoQiang123
Copy link

@SunGuoQiang123 SunGuoQiang123 commented Dec 25, 2019

Version

3.1.2

Reproduction link

https://codepen.io/sungunguoqiang/pen/vYEZmpN?editors=1112

Steps to reproduce

App component created hook executed, the error emit this.TEST is not a function

What is expected?

no error happen

What is actually happening?

an error emitted when called in created hook, and also mapActions also has the same problem.
if call by the this.$store.commit('TEST'), it's right


mapState and mapGetters are right, but mapMutations and mapActions are not right

@ktsn

This comment has been minimized.

Copy link
Member

@ktsn ktsn commented Dec 25, 2019

It is not method but methods

https://vuejs.org/v2/api/#methods

@ktsn ktsn closed this Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.