In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of the method of vue route jump router-link to clear history records, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe that you will gain something after reading this article on the method of vue route jump router-link to clear history records. Let's take a look at it.
Route Jump router-link clears History
1. When we talk about route hopping in the vue project, the first thing we think of is the router-link tag and the this.$router.push function.
The implementation principle of router-link is the same as that of this.\ $router.push. When you click router-link, the internal call is this.$router.push.
The 2.this.\ $router.push method adds a new record to the history stack, so when the user clicks the browser back button, it goes back to the previous URL.
So how do we get rid of the history when we use route jumps?
The official documentation provides the following three ways
1. Remove the history when using the router-link tag: add the replace attribute
Project list
two。 Remove the history when using the this.\ $router.push tag: add the replace attribute, and the default value is false
This.$router.push ({path:'/ project_selection',replace:true})
3. Remove the history when using the this.\ $router.replace tag
This.$router.replace ({path:'/ project_selection'})
All the content comes from the official website: vue routing core plug-in
Vue does not record history after jumping
Vue route hopping is usually done using push.
This.$router.push ({path: "/ testTeam/testTeam",})
If there is a special need, the page will not be recorded in the history after the page is redirected. Just change push to replace.
This is the end of the article this.$router.replace ({path:'/ project_selection'}) on "the method of vue Route Jump router-link to clear History". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "vue routing jump router-link clearing history method". If you want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.