Currently, my process involves fetching data from a database and storing it in vuex. I am able to retrieve the data using a getter in the setup method, but I would like to manipulate some of that data before the page is rendered, ideally in the onMounted method. However, I am unsure how to achieve this using the Compositions API. Here is a snippet of my code:
setup() {
const store = useStore();
//store.dispatch(Actions.LOAD_COMMUNITY);
onMounted(() => {
store.dispatch(Actions.LOAD_COMMUNITY);
setCurrentPageTitle(this.community.communityName);
});
return {
community: computed(() => store.getters.currentCommunity),
};
},
Unfortunately, when attempting this approach, I encounter a "Cannot find name 'community'" error and using this.community does not resolve the issue.
If anyone has any insights or solutions on how to tackle this problem, I would greatly appreciate your assistance.