Looking for assistance in setting up a universal function that can be accessed across all my Vue files.
For example, when using this code snippet in a Vue file:
@click="ModalShow.show('my-create')"
I have defined the following constant in my app.js
:
const Modals = {
show(screen) {
alert(screen);
// additional logic to be executed
},
};
However, I am encountering the error message:
TypeError: undefined is not an object (evaluating '_ctx.Modals.show')
Any ideas on what might be missing? This is within a Vue project utilizing the composition API.