Correct answer Using // router path: "/user/:uid" <template> <div>user</div> <p>uid: {{ uid }}</p> </template> <script lang="ts"> import { defineComponent } from "vue"; import { useRouter } from "vue-router"; export default defineComponent({ name: "User", setup() { const router = useRouter(); const uid = router.currentRoute.value.params.uid; return { // Returned data uid, }; }, }); </script> Explain Use This concludes this article about how to get the current routing address in vue3. I hope it will be helpful for everyone’s study, and I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: 10 key differences between HTML5 and HTML4
>>: Clever use of webkit-box-reflect to achieve various dynamic effects (summary)
Several parts of Compose deal with environment va...
This article shares the specific code of vue echa...
You may often see some HTML with data attributes. ...
Variables defined in SASS, the value set later wi...
Whether you're trying to salvage data from a ...
Table of contents Code: Replenish: Summarize Requ...
Virtual machines are very convenient testing soft...
Preface This article mainly introduces the releva...
This article shares with you the specific code of...
<frameset></frameset> is familiar to e...
The image integration technology used by American...
Table of contents 1: Encapsulation idea 2. Packag...
introduction As usual, let's start with a sce...
Table of contents first step Step 2 Step 3 Step 4...
The first one: normal operation SELECT SUM(ddd) A...