Recently starting to work with Vue, I encountered an issue while trying to utilize a helper function called arrayDateFormatter within one of my imported .vue files. Despite importing it, the function doesn't seem to be called when used inside the mounted()
method, and nothing executes after it. Interestingly, no errors are displayed in the console.
Here is a snippet from my Vue file:
<template>
.....
</template>
<script>
import archives from "@/4.objects/o-archives";
import fullBanner from "@/4.objects/o-full-banner";
import speakerInfo from "@/4.objects/o-speaker-info";
import newsletter from "@/4.objects/o-newsletter";
import dataLoaderMixin from "@/mixins/dataLoader-mixin";
import arrayDateFormatter from "../mixins/gloabalEventsDateFormate-mixin";
export default {
components: {
....
},
mixins: [dataLoaderMixin],
data() {
return {
speakers: [],
talkInfo: null,
archives: []
};
},
async mounted() {
try {
const response = await this.fetchEventsByProject();
console.log(response.data.data.listOnlineEvents.items);
//nothing gets triggered after here
const currentEvent = arrayDateFormatter(response);
console.log('current event');
console.log(currentEvent);
this.archives = this.fetchData("archive");
} catch (err) {
return err
}
}
};
</script>
Here's the code for the helper function:
export const arrayDateFormatter = (response)=> {
//some code i have tested and it works by itself
}