title: How to access data from outside the instance in Vue js?
body: <p>I'd like to get access to vm data from outside the instance like so:</p>
  <p><strong>myComponent.vue</strong></p>
  <pre><code>export default {
      data() {
          return {
              name: 'Joe'
          };
      }
  }
  </code></pre>
  <p><strong>main.js</strong></p>
  <pre><code>var vm = new Vue({
      el: '#app',
      render: h =&gt; h(myComponent)
  });
  </code></pre>
  <p><strong>Desired Result</strong></p>
  <pre><code>console.log(vm.name);   // should return - Joe
  </code></pre>
  <p>For some reason, console returns undefined. What I'm doing wrong?</p>