Within my main.js file, I have configured Vue as follows:
window.Vue = require('vue');
Vue.component('my-component', require('./components/MyComponent.vue'));
const app = new Vue({
el: '#app',
});
Additionally, a function is defined in the main.js file:
function test() {
//do something
}
Is there a way to invoke the test method from inside a vue component? While I understand this may not be the most ideal setup, I am currently working with legacy components.