this. $router. The difference between push, replace, go

Source: Internet
Author: User

1.this. $router. Push ()

Description: Jump to a different URL, but this method adds a record back to the history stack, and clicking back returns to the previous page.

Usage:


2.this. $router. Replace ()

Description: Also jumps to the specified URL, but this method does not add a new record to the history, click Back, will jump to the previous page. The previous record does not exist.

3.this. $router. Go (N)

The number of pages that jump forward or backward relative to the current page, similar to Window.history.go (n). n can be positive to negative. Positive numbers return to previous page


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.