I created a project in Vue.js 3 and TypeScript.
router.js
{
path: "/app/:id",
name: "Detail",
component: Detail,
props: true
},
App.js
<script lang="ts">
...
onMounted(() => {
const id = $route.params.id;
...
});
But this results in an error:
"Cannot find name '$route'."
What am I doing wrong?