title: Update data in Vue.js Mounted() doesn't work
body: <p>I try to update some data in my mounted part, in my Vue.js component. Here is my code :</p>
  <pre><code>  methods: {
      initData() {
        const self = this;
  
        axios
          .get(&quot;/checkAuthentification&quot;)
          .then((response) =&gt; {
            (self.userFields.userAuthenticated = response.data),
              console.log(&quot;method&quot;),
              console.log(self.userFields.userAuthenticated),
              console.log(&quot;reponse&quot;),
              console.log(response.data);
          })
          .catch((error) =&gt; {
            (self.errors = error.response.data.errors || {}),
              console.log(self.errors);
          });
  
        console.log(&quot;between&quot;);
  
        console.log(self.userFields.userAuthenticated);
  
        if (self.userFields.userAuthenticated == &quot;true&quot;) {
          axios
            .get(&quot;/getAuthenticatedUserData&quot;)
            .then((response) =&gt; {
              (self.userId = String(response.data.id)),
                (self.userFields = response.data),
                console.log(&quot;user data&quot;),
                console.log(response.data);
            })
            .catch((error) =&gt; {
              (self.errors = error.response.data.errors || {}),
                console.log(self.errors);
            });
        }
      },
    },
    mounted() {
      this.initData();
    },
  </code></pre>
  <p>In the first axios call, it works perfectly, the two console log give the expected value &quot;true&quot;. But on the next console.log after between, it says 'undefined'. Thue userFields doesn't update after the firt axios call. I don't understand because i did the same thing on a submit button on a form, and it worked perfectly.
  I ask here because I looked other posts and the answer is always to use const=this, which I did.
  Thank you for your help !</p>