How does vue-router clear all its previous history after arriving on a page?

A page-> B page (can return A)-> C page (cannot return B or A)
how to achieve this effect?

Mar.03,2021

router.replace (location, onComplete?, onAbort?)

is very similar to router.push , except that it does not add a new record to history, but replaces the current history record just like its method name.

https://router.vuejs.org/zh-c.


if I want to reach a page before emptying, other pages should be kept


solved? I want to achieve something similar to app returning to the tabbar page can not return the tabbar page how to clear the history


solved. I want to achieve the same function.

Menu