1

I've got an external code that calls on a specific function name someEvent() and I cannot change this file as it belongs externally.

Currently, I have defined the function someEvent() in a separate a.js file in the @/static folder:

function someEvent(e) {
    // I want to call my Nuxt page methods here
}

and included in my head():

export default {
    head() {
         script: [
             { src: 'a.js' }
         ],
    }
}

How do I call my index.vue methods here in this a.js? Or if you have a better method, I welcome any suggestions.

theodoray
  • 13
  • 2
  • I think you can find what you are looking for in [here](https://stackoverflow.com/questions/45047126/how-to-add-external-js-scripts-to-vuejs-components) – Vladimir Dimitrov Jun 24 '20 at 09:19
  • Hi, I can include the files, but what I want to do is for a.js to call my component methods. Thanks for the link however – theodoray Jun 25 '20 at 02:00

0 Answers0