I have initialized a Vue instance
var app = new Vue(
{...}
)
Additionally, I have defined a class named CustomTooltip
class CustomTooltip {
constructor(array_data,vue_instance) {
this.tooltip_data = array_data;
this.vue_instance = vue_instance
console.log(app)
}
}
While trying to utilize the 'app' instance within certain methods of the CustomTooltip class, I encountered an error message stating
Uncaught SyntaxError: Unexpected strict mode reserved word
. This issue was resolved by passing the Vue instance to the constructor, although it now requires passing the app
variable each time a new CustomTooltip instance is created.
Can anyone explain why this error is occurring? How can I resolve this issue effectively? Should I consider a different approach?