I'm facing a challenge in displaying plan data on my Vue application. The data is fetched from an API running locally. Although I have successfully added the data to the store/vuex and verified its correctness using vue dev tools, I am unable to visualize it on the user interface. I need assistance in troubleshooting why the data isn't appearing on the UI.
Within my plans.vue
file, I simply utilize a for loop over the plans
data, which works when I manually input the data into the array. Therefore, there seems to be an issue between the store and the data prop causing the problem.
store.js
state: {
plans: []
}
mutations: {
loadPlans(state, plans) {
state.plans = plans
}
},
getters: {
loadPlans(state) {
return state.plans
},
}
plans.vue
created() {
PageOptions.pageEmpty = true;
this.$store.dispatch('loadPlans')
},
data() {
return {
plans: this.$store.getters.loadPlans,
}
},
This code snippet has been simplified to focus solely on the issue at hand; there is additional unrelated code present as well.