Vue · Junior · Question 47 of 75

How do you navigate from code, e.g. after saving a form?

Explanation

router.push adds a history entry, router.replace replaces the current one and router.back() goes back. Both accept strings or objects like { name: 'user', params: { id } }.

Further reading

Problem with a question

Vue · Junior · question 47

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