title: Vue/ Nuxt - mounted: () => Vs mounted: function()
body: <p>Why the results are different for using <code>() =&gt;</code> and <code>function()</code> in <code>mounted</code>:</p>
  
  <pre><code>export default {
    mounted: () =&gt; {
      this.socket = 'something'
      console.log('mounted')
    },
    methods: {
      submitMessage() {
        console.log(this.socket) // undefined
      }
    }
  }
  </code></pre>
  
  <p>Using <code>function()</code>:</p>
  
  <pre><code>export default {
    mounted: function() {
      this.socket = 'something'
      console.log('mounted')
    },
    methods: {
      submitMessage() {
        console.log(this.socket) // something
      }
    }
  }
  </code></pre>
  
  <p>Any ideas?</p>