title: How to get params of router in vue 3?
body: <p>I created a project in Vue.js 3 and TypeScript.</p>
  <p>router.js</p>
  <pre><code>{
      path: &quot;/app/:id&quot;,
      name: &quot;Detail&quot;,
      component: Detail,
      props: true
    },
  </code></pre>
  <p>App.js</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script lang=&quot;ts&quot;&gt;
  
  ...
  
  onMounted(() =&gt; {
        const id = $route.params.id;
        ...
      });
  </code></pre>
  <p>But this results in an error:</p>
  <pre><code>&quot;Cannot find name '$route'.&quot;
  </code></pre>
  <p>What am I doing wrong?</p>