title: Vue-Router: Cannot read property '$route' of undefined - VueJS
body: <p>Please review my code.</p>
  
  <pre><code>&lt;template&gt;
    &lt;div class="row flex"&gt;
      &lt;div class="col-md-6 home_feed"&gt;
        &lt;post-detail :posts="posts"&gt;&lt;/post-detail&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
    import axios from 'axios'
    export default {
      async asyncData (params) {
        let { data } = await axios.get('http://localhost:8000/api/v1/users/' + this.$route.params.id + '/')
        return {
          posts: data
        }
      },
      components: {
        'post-detail': Item
      }
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>I got this error: <code>Cannot read property '$route' of undefined</code> when I asyncdata from params.id, but when I type: console.log(this.$route.params.id), it goes right. How can I fix this</p>