Vue $route is not defined
问题 I'm learning Vue router. And I want to made programmatic navigation (without <router-link> ). My router and view: router = new VueRouter({ routes: [ {path : '/videos', name: 'allVideos', component: Videos }, {path : '/videos/:id/edit', name: 'editVideo', component: VideoEdit }, ] }); new Vue({ el: "#app", router, created: function(){ if(!localStorage.hasOwnProperty('auth_token')) { window.location.replace('/account/login'); } router.push({ name: 'allVideos' }) } }) So by default I push to