Access js function from another file to Vue component
forum.vuejs.org › t › access-js-function-fromApr 22, 2019 · I am using Vue 2.6.2. With this version I am trying to create some components to help on UI front. I am having another js file of user defined functions. What I am trying to do is access function from js file to Vue components. How can I achieve this? I did looked for solution at different forums, but they all suggest exporting function from js file and import them to Vue component file. But I ...
How to call a vue component method from another js file
var bus = new Vue() // in component A's method bus.$emit('openModal', params) // in component B's created hook bus.$on('openModal', function(params) { // ... }) The most common centralized state management library for Vue is Vuex, which is analogous to Flux/Redux/etc.