binggle
10 months ago
2041
2
Vue

How to send parameters to MapAction ?

Posted 10 months ago by binggle

in store/auth.js

actions: {
    fetchLogin({commit}, objUser ) {
        const url = EndPoints.find( ep => ep.name ==='login').path ;
        this.axios.get( url , objUser )
        .then(function (response) {
            console.log( response )
        })
        .catch(function (error) {
            console.log( error )
        });
    }
  }

How can I call fetchLogin with payload in Login.vue ?

methods: {
    ...mapActions({
      login: 'auth/fetchLogin',
    }),
}

I guess this is not enough .

Please sign in or create an account to participate in this conversation.