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.