1. 程式人生 > >vue router跳轉方法

vue router跳轉方法

his 指定 tail 區別 用法 ont src 2.0 term

1.this.$router.push()

描述:跳轉到不同的url,但這個方法會向history棧添加一個記錄,點擊後退會返回到上一個頁面。

用法:

技術分享圖片

2.this.$router.replace()

描述:同樣是跳轉到指定的url,但是這個方法不會向history裏面添加新的記錄,點擊返回,會跳轉到上上一個頁面。上一個記錄是不存在的。

3.this.$router.go(n)

相對於當前頁面向前或向後跳轉多少個頁面,類似 window.history.go(n)。n可為正數可為負數。正數返回上一個頁面

技術分享圖片

vue-router 2.0 常用基礎知識點之router.push()

https://blog.csdn.net/sinat_17775997/article/details/68941091

this.$router.push、replace、go的區別

http://www.cnblogs.com/hwldyz/p/9204346.html

vue router跳轉方法