[Vuejs]-Refer to Vue instance from another element instance

1👍

If you can use ES6 features, than arrow functions will help, they dont change this.

this.map.markers.user.on("moveend", (e) => {
    this.showSubmit(e);
}); 

2👍

Bind this instance like the following –

this.map.markers.user.on("moveend", function(e) {
  this.showSubmit(e);
}.bind(this));

Leave a comment