Vuex error and action following the click

You should give an alias while mapping your action into methods so you can prevent name collision:

methods: {
...mapActions('ModalModule', {
    'toggleShowModal' : 'showModal',
}),

And then in your template use the alias :

<button class="bg-green-500 active:bg-green-600 uppercase text-white font-bold hover:shadow-md shadow text-xs px-4 py-2 rounded outline-none focus:outline-none sm:mr-2 mb-1 ease-linear transition-all duration-150"
  type="button"
  @click="toggleShowModal()"
 >

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top