Vue · Junior · Question 67 of 75
How do you navigate to a route by its name?
router.push({ name: 'user', params: { id: 42 } })- ✓Correct answer: Pass an object with
nameandparamstorouter.push - 2Names can be used only in
<RouterLink> - 3Use
router.go('user')
Explanation
Named routes don't break when the URL path changes, and params are encoded automatically.