Capture URL values in on template navigation

I have defined a route as /my-site/:id

How do I capture the value in :id after I navigate to my template?

<script>
  return {
  
		data: function() {
		
			//route /my-site/:id
			
			var $ = this.$;
			var app = this.$app;
			var router = this.$router;
		
			//log /:id
			console.log('');
		
		}
	
	}
</script>

Thanks.

Hey @davykiash

Use:

var self = this;
self.$route.params.id

Tell me if your question is resolved

Regards

1 Like