Accessing $route.params in VueJS Accessing $route.params in VueJS vue.js vue.js

Accessing $route.params in VueJS


If you're using the Vue Loader setup (which has <template></template> tags in the files), you need to use this to reference the $router, if you're doing so within the <script></script> part of the file.

 console.log('The id is: ' + this.$route.params.id);