title: Vue: Access Vue instance from function outside instance scope
body: <p>This is a small portion of my data object. Basically, it's used to create a navigation menu. Inside that navigation menu there are certain buttons that should trigger functions, and I figured I'd create the functions inside the data object because it's the clearest way to make it.</p>
  
  <p>However, <code>this</code> does not return a vue object. So apart from making the vm part of the global scope I'm at a loss for how I would do this.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>const data = {
    login: {
      title: "Log in",
      icon: "fa fa-sign-in",
      action: function () {
        console.log("Log in");
        // This is where I want to access the vm, e.g. like this:
        // this.$root.showLoginBox();
      }
    }
  }
  </code></pre>