As someone new to JavaScript, I am trying to incorporate external functions into Vue component data bindings, but I am encountering issues.
helper.js
function groupArrayOfObjects(list, key) {
return blah blah
}
function parseDate(d) {
return bla bla
}
export { groupArrayOfObjects, parseDate };
vue component:
Vue warn]: Property or method "parseDate" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
<template>
<div>{{parseDate(date) }}</div>
</template>
import { groupArrayOfObjects, parseDate } from "@/assets/js/helper.js";
export default {
methods:{
abc(){ groupArrayOfObjects(param1, param2);}
}
}