Router-link clear history
1. When talking about routing jump in vue project, the first thing we think of is the router-link tag and this.$ function.
The implementation principle of router-link and this.\$ is the same. When clicking router-link, this.$ is called internally.
.\$This method adds a new record to the history stack, so when the user clicks the browser back button, it returns to the previous URL.
So how do we remove the history when we use route jump?
The official documentation provides the following three methods
1. Remove the history when using the router-link tag: add the replace attribute
<router-link to='/project_selection' replace class='btn_none' tag="a">Project List</router-link>
2. Remove the history when using this.\$ tag: add the replace attribute, the default value is false
this.$({path: '/project_selection',replace:true})
3. Remove history when using this.\$ tag
this.$({path: '/project_selection'})
All content comes from the official website:vue routing core plugin
No history records are recorded after vue jump
In general, push is used.
this.$({ path: "/testTeam/testTeam", });
If it is a special requirement, the page will not be recorded in the history after jumping, just change push to replace.
this.$({path: '/project_selection'})
The above is personal experience. I hope you can give you a reference and I hope you can support me more.