今天一位网络朋友用hbuder写的网页转成app,问我:点手机上的返回键如何返回上一级?具体方法如下:
1、返回上一页,不刷新history.html
window.history.go(-1);
javascript:window.history.go(-1)
2、返回上一页并刷新页面
javascript:location.replace(this.href);event.returnValue=false;
3、返回上一页并刷新
self.location=document.referrer
4、返回上一页面刷新的是自己
javascript:document.parentWindow.location.reload();
注意:
vue是页面开发,没有上一层,因此,vue 返回上一层的方法,
this.$router.go(-1)