Skip to content

mapActions helper how to pass payload #611

@ArielGueta

Description

@ArielGueta

There is a way to pass payload to the mapActions helper?

For example:

 Vue.component('login', {
       template: template,
	data() {
		return {
			email: "",
			password: ""
		}
	},
	methods: {
		...mapActions("auth", ["login"]) 
	},
});

How can I pass the email and password to the action without doing this:
this.$store.dispatch("auth/login", {email: this.email, password: this.password});

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