Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does vuejs return to the previous page

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to return to the previous page of vuejs". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to return to the previous page of vuejs".

Vuejs implementation returns a page of the method: 1, through the "goOff () {this.$router.go (- 1);}," method implementation click to return to the previous page; 2, through the "methods: {back () {if () {...}" way to return to the previous page, if there is no previous page, return to the home page.

This article operating environment: windows7 system, vue2.9.6 version, DELL G3 computer.

How does vuejs return a page?

The vue implementation clicks the button to return to the previous page:

How do I click the button to return to the previous page?

This is the range html code for vue mounts

Return

Here is how to click back

The first only returns to the previous page.

GoOff () {this.$router.go (- 1);}

The second method returns to the previous page, or to the home page if there is no previous page.

Methods: {back () {if (window.history.length {/ / skillfully use the arrow function if (! res) {return;} this.allProfit = res.Profit / / res is all the data returned in the background that needs to be received and saved})}} Thank you for your reading. This is the content of "how vuejs returns to the previous page". After the study of this article, I believe you have a deeper understanding of how vuejs returns to the previous page, and the specific usage still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report