本人学到的手机指定跳到某一页面的代码:
methods:{
fun(){
this.$router.push(要指定跳转的页面);
}
},
mounted(){
if(window.history && window.history.pushState){
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.fun, false) //false阻止默认事件
}
},
destroyed(){
window.removeEventListener('popstate', this.fun, false) //false阻止默认事件
}
以上操作完就可以阻止了,还有对里面有些解释的我就给网上链接了哦, 如下:
https://blog.csdn.net/jiangyu1013/article/details/84256790