title: Vue $route is not defined
body: <p>I'm learning Vue router. And I want to made programmatic navigation without using <code>&lt;router-link&gt;</code> in templates file.
  My router and view:</p>
  <pre><code> router = new VueRouter({
          routes: [
              {path : '/videos',  name: 'allVideos', component: Videos },
              {path : '/videos/:id/edit', name: 'editVideo', component: VideoEdit },
          ]
      });
  
      new Vue({
          el: &quot;#app&quot;,
          router,
          created: function(){
              if(!localStorage.hasOwnProperty('auth_token')) {
                  window.location.replace('/account/login');
              }
  
              router.push({ name: 'allVideos' })
          }
      })
  </code></pre>
  <p>So by default I push to 'allVideos' route and inside that component I have a button and method for redirecting to ''editVideo'
  button:</p>
  <pre><code>&lt;button class=&quot;btn btn-sm btn-warning&quot; @click=&quot;editVideo(video)&quot;&gt;Edit&lt;/button&gt;
  </code></pre>
  <p>method:</p>
  <pre><code>editVideo(video) {router.push({ name: 'editVideo', params: { id: video.id } })},
  </code></pre>
  <p>It works fine. But when I try to get id inside a VideoEdit component using <code>$route.params.id</code> I got error <strong>Uncaught ReferenceError: $route is not defined</strong></p>
  <p>Maybe it's because I'm not using npm for now just a cdn version of Vue and Vuerouter. Any solutions? Thanks!</p>
  <p><strong>Updated:</strong> btw in Vue dev tool I see $route instance inside the component</p>
  <p><strong>Updated:</strong></p>
  <pre><code>var VideoEdit = Vue.component('VideoEdit', {
            template: ` &lt;div class=&quot;panel-heading&quot;&gt;
                          &lt;h3 class=&quot;panel-title&quot;&gt;Edit {{vieo.name}}&lt;/h3&gt;
                      &lt;/div&gt;`,
                  data() {
                      return {
                          error: '',
                          video: {},
                  }
              },        
              created: function () {
                    console.log($route.params.id);
              },
    })
  </code></pre>