1👍
✅
Try moving the initial store.dispatch('loadComments')
into the created hook of your component.
export default {
data: function () {
return {}
},
methods:{
submit(){
let formData = new FormData(this.$refs.form)
this.Redirect(`https://www.myapp.eu/parks/${encodeURIComponent(booking_url)}/park_availability/`);
console.log(this)
console.log(this.$store.state)
this.$store.dispatch("searchAccommodations", formData)
}
},
created () {
this.$store.dispatch('loadComments')
}
}
Source:stackexchange.com