Here is the code snippet for my component:
<div id="event-picker">
<template v-for="event in $store.state.events">
<a href="#" v-on:click.prevent="$store.dispatch('prepareEventForm', event)">{{ event.artist }}</a>
</template>
</div>
This is how my store's mutations look like:
prepareEventForm(state, event) {
state.form.time = event.time
state.form.date = event.date
state.form.event = event.event
state.form.artist = event.artist
state.form.organizer = event.organizer
state.form.location = event.location
state.showForm = true
}
I am encountering an error which states
Cannot read property 'time' of undefined
Where do you think the issue might be?
UPDATE:
Below is my action method definition:
prepareEventForm({ commit }) {
commit('prepareEventForm')
}