0👍
If you really want to add a “global” method to your VueJs app you can add it to Vue itself like this:
import {logEngagement} from "./helpers/logEngagement"
Vue.prototype.$logEngagement = logEngagement;
you can use it in component.vue like this:
<script>
export default {
mounted() {
this.$logEngagement.log("this");
}
}
<script>
Source:stackexchange.com