The role of push and replace: control the mode of operating browser history when routing jumps
The browser has two buttons, one is forward and the other is back, they all depend on the history of the browser
The return key of this browser is the mode of the mode stack, and the characteristic is that a section is sealed. (The following is a schematic diagram)
The browser defaults to push mode
Q: What is push mode?
Answer: In the array, there is an array element appended at the end is the push mode. It does not destroy the previous result but just appends it.
In addition to the push mode and the replace mode
The biggest feature is to replace the current record
Let's explain the current (below is a schematic diagram)
When we go back from the top path, we can only go back to 8080/#/about because the previous one has been replaced
So how do we enable the replace mode?
<router-link :replace=“ture”> <router-link>
<router-link replace> <router-link>//简写模式