title: Vue js "this" is overridden with image.onload "this"
body: <p>I have a vue app. I use <code>this.data</code> to access it's data variables and methods.</p>
  
  <p>In a certain method I have to use img.onload to get the width of an image. But there are 2 "<strong>this</strong>" now and vue js methods and variables are not working now. I need an alternative solution so both will work.</p>
  
  <pre><code>vueMethod(url) {
   var img = new Image();
   img.onload = function() {
    this.size = {this.width,this.height}  //size is a vue variable
   }
   img.src = url;
  }
  </code></pre>