首頁 > 問答 > 主體
頁面路由配置了兩個
{ path: 'index', name: 'introduce', component: page.introduce, }, { path: 'detail', name: 'detail', component: page.detail, }
由先由index跳到detail, detail再跳轉其他地址如百度或什麼的,再點擊微信端的返回,如何直接返回到第一個頁面?
天蓬老师2017-05-16 13:44:06
跳到百度之後就不歸你管了.可以在你的路由或元件裡面判斷document.referrer是不是為其他網址.是的話回傳第一個頁.
伊谢尔伦2017-05-16 13:44:06
window.location.replace()
這個.$router.replace()