title: Declaring dynamic data in a component, Vuejs 2
body: <p>I'm begining now with vue js 2. I have this code, which receives dynamic data from the server (laravel 5.3 app), the problem is when i try to declare the users array on the component instead of declaring in the Vue() instance (in this case works great):</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="app"&gt;
      &lt;my-component&gt;
          &lt;ul id="users-list"&gt;
              &lt;li v-for="user in users"&gt;{{user.name}}&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/my-component&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>Vue.component('my-component', {
      template: '#users-list',
      data: function () {
          return {
              users: []
          }
      },
      mounted: function() {
          this.$http.get('http://127.0.0.1:8003/api/test').then((response) =&gt; {
              console.log(response.body);
              this.users = response.body;
          }, function() {
              alert('brrh');
          });
      }
  });
  new Vue({
      el: '#app',
  });
  </code></pre>
  
  <p>The error message: "Uncaught ReferenceError: users is not defined"</p>