title: How to set a value inside a variable on data() using a function?
body: <p>I'm creating a Vue.js component inside a Laravel App.</p>
  
  <p>After I catch the response with an axios request, I can't put a value inside a variable on method data()</p>
  
  <p>Here is the code:</p>
  
  <p><b>app.js</b></p>
  
  <pre><code>require('./bootstrap')
  
  window.Vue = require('vue')
  
  Vue.component('card', require('./components/card.vue'))
  
  
  let app = new Vue({
      el: '#app'
  })
  </code></pre>
  
  <p><b>card.vue</b></p>
  
  <pre><code>&lt;script&gt;
  module.exports  = {
      props: [
          'name'
      ],
      data: function() {
          return {
              projects: [],
          }
      },
      mounted() {
          this.getProjects() // NOT WORK?
      },
      methods: {
          getProjects: function() {
              axios.get('/api/v1/getProjects').then(function (response) {
  
                  console.log(response.data)
                  this.projects = response.data // NOT WORK
  
              }).catch(function (error) {
  
                  console.log(error)
  
              }).then(function () {
  
              })
          },
      }
  }
  &lt;/script&gt;
  </code></pre>