title: Referring to `this` vue component within an event handler
body: <p>Given this Vue component that attaches a global event listener:</p>
  
  <pre><code>var app = new Vue({
      data: {
          foo: 0;
      },
      methods: {
          handle: function(e) {
              this.foo = 1; // this refers to handler, not app
          }
      },
      mounted: function() {
          window.addEventListener("keypress", this.handle);
      }
  });
  </code></pre>
  
  <p>What is the correct way to refer to <code>this</code> from within the event handler in order to update the component state? Alternatively, is there a better way to set event handlers on the entire <code>window</code>?</p>