I have tried setting the v-if value in computed, data, passing it as props, and directly referencing state, but it never seems to re-render despite the fact that the state I am checking for is changed to true.
Currently, I am directly referencing the store:
<template v-if="this.$store.state.showReviews">
I make an AJAX request in my Vuex action:
getBikeReviews(context, i){
console.log("getBikeReviews");
axios.get('http://mpaccione.com/wp-content/themes/webdev/projects/Web_Design_4/Creating_Online_Store/api/get_reviews.php?index='+i).then((res) => {
context.commit('storeBikeReviews', {"index": i, "json": res.data});
context.commit('showReviews', true);
});
}
The state is mutated to true:
showReviews (state, payload){
console.log("showReviews");
state.showReviews = payload;
}
Nevertheless, the template never reloads.