In the process of developing my website based on the Nuxt TypeScript Starter template, I've encountered a challenge. Specifically, I have created a dynamically routed page named _id.vue within my pages folder and am looking to access the id property inside my TypeScript class.
Although I can successfully retrieve the id value in my template using {{$route.params.id}}
, attempting to reference $route
within the class results in an error:
Error TS2304: Cannot find name '$route'.