title: Simple VueJS issue (setting $data in mounted)
body: <h1>Edit</h1>
  <p>The Component.vue provided was part of a larger web app so I ripped out the relevant code for this question. What I didn't notice was a VERY tiny change I made in ripping out the code that had a very big impact.</p>
  <p>There's a difference between:</p>
  <pre><code>mounted() {
      // ....
  }
  </code></pre>
  <p>and:</p>
  <pre><code>mounted: () =&gt; {
      // ....
  }
  </code></pre>
  <p>Upon careful investigation this morning I found this mistake in my code and I've updated the question to reflect the actual code that was failing.</p>
  <h1>Question</h1>
  <p>I may just be tired, but before going to bed I wanted to ask for help here and see if someone can find my issue. I have a very simple Vue component that isn't working:</p>
  <p>Component.vue:</p>
  <pre><code>&lt;template&gt;
      &lt;div&gt;
          &lt;p v-for=&quot;item in items&quot;&gt;{{ item.text }}&lt;/p&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      export default {
          data() {
              return {
                  items: []
              };
          },
          mounted: () =&gt; {
              var _this = this;
              $.ajax(&quot;/items.json&quot;).done(result =&gt; {
                  _this.items = result;
              });
          }
      };
  &lt;/script&gt;
  </code></pre>
  <p>items.json</p>
  <pre><code>[
      {&quot;text&quot;: &quot;ABC&quot;},
      {&quot;text&quot;: &quot;XYZ&quot;}
  ]
  </code></pre>
  <p>The paragraphs are never rendering. Upon inspection it looks like <code>_this.items</code> doesn't exist prior to setting it in the AJAX handler (I expect it to be an empty array) and <code>_this.$data</code> also doesn't exist</p>
  <p>~Is the value of <code>this</code> different in the mounted method than elsewhere in Vue?~ <strong>Or did I make a simple mistake?</strong></p>
  <p>Writing the <code>mounted</code> function in this way (with the colon) causes the value of <code>this</code> to be different. Why is that?</p>