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)
Recently, Xiao Ming just bought a new Mac and wan...
1. Find out whether MySQL was installed before Co...
Basic Concepts Absolute positioning: An element b...
Table of contents Create a new user Authorize new...
There are two special values that can be assign...
What is a file system We know that storage engine...
Table of contents 1. Introduction 2. Simple defin...
1. Create a MySQL database 1. Create database syn...
Solution: Bind the click event to the audio compo...
History always repeats itself surprisingly well. ...
In actual work or interviews, we often encounter ...
Table of contents Features Advantages Installatio...
Introduction to Angular Angular is an open source...
There is often a lack of understanding of multi-c...
This article uses examples to illustrate the MySQ...