We can access the dynamic route data through the params key when we have dynamic routes in our app. For example, if we have an _id.vue file in the /pages/ directory, then we can access the value of the route parameter via context.params.id as follows:
// pages/users/_id.vue
<p>{{ id }}</p>
export default {
asyncData ({ params }) {
return { id: params.id }
}
}
In the preceding code, you will get 1 for the id when calling users/1 on the browser.