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

What are the differences between go and back in vue

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "what is the difference between go and back in vue". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the difference between go and back in vue".

The differences between go and back in vue are: 1, using go () to return to the original page will refresh the interface, while using back () to return to the original page will not refresh; 2, using go () to return the content in the original page form will be lost, while using back () to return the original page form content will be retained.

This article operating environment: windows10 system, Vue2.9.6 version, DELL G3 computer.

What is the difference between go and back in vue

When you encounter the need to return to the previous page in development, there are two ways to choose:

1.$router.back ()

2.$router.go ()

Found in use, using r o u t e r. Back () and router.go (- 1) do the same thing, returning to the original page. However, if the original page route carries parameters, the original page routing parameters returned by the above two methods disappear, and the original page routing parameters returned using $router.back (- 1) still exist.

Go (- 1): the content in the original page form will be lost

This.$router.go (- 1): back + refresh

This.$router.go (0): refresh

This.$router.go (1): forward

Back (): the contents of the original page table form are retained

This.$router.back (): back up

This.$router.back (0) refresh

This.$router.back (1): forward

Thank you for your reading, the above is "what is the difference between go and back in vue?" after the study of this article, I believe you have a deeper understanding of the difference between go and back in vue, and the specific use 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