Page routing is configured with two
{
path: 'index',
name: 'introduce',
component: page.introduce,
},
{
path: 'detail',
name: 'detail',
component: page.detail,
}
First jump from index to detail, detail then jump to other addresses such as Baidu or something, and then click return on WeChat. How to return directly to the first page?
After jumping to Baidu, it will no longer be under your control.
You can determine whether the document.referrer is for another URL in your routing or component. If so, return to the first page.
window.location.replace()
this.$router.replace()