Vue · Junior · Question 46 of 75

How do you read the :id param of the route /users/:id in <script setup>?

Explanation

useRoute() returns the reactive current route (params, query, hash). useRouter() returns the router instance for navigation.

Further reading

Problem with a question

Vue · Junior · question 46

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz