javascript - vue-router路由跳到其他位址,如何不保留歷史記錄
为情所困
为情所困 2017-05-16 13:42:06
0
3
966

頁面路由配置了兩個

{
  path: 'index',
  name: 'introduce',
  component: page.introduce,
},
{
  path: 'detail',
  name: 'detail',
  component: page.detail,
}

由先由index跳到detail, detail再跳轉其他地址如百度或什麼的,再點擊微信端的返回,如何直接返回到第一個頁面?

为情所困
为情所困

全部回覆(3)
Peter_Zhu

跳到百度之後就不歸你管了.
可以在你的路由或元件裡面判斷do​​cument.referrer是不是為其他網址.是的話回傳第一個頁.

伊谢尔伦

window.location.replace()

Peter_Zhu

這個.$router.replace()

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!