需求描述

H5页面中为了引导用户从老版的H5页面地址中进入新版的H5页面地址。当用户登录后直接跳转到新的地址。

解决问题

​ 1.当前页面打开新页面

self.location.href="https://blog.csdn.net/weixin_49175501" ;

location.href="https://blog.csdn.net/weixin_49175501" 

window.location.href="https://blog.csdn.net/weixin_49175501l" 

​ 2.在父页面打开新页面

parent.location.href="https://blog.csdn.net/weixin_49175501" 

​ 3. 在顶层页面打开新页面

top.location.href="https://blog.csdn.net/weixin_49175501" 

​ 4. 跳转可以传递参数

window.location.href=`https://blog.csdn.net/weixin_49175501?value=${e}` 

​ 5. 接收参数

<script>
	export default{
        onload(option){
            console.log(option.value);
        }
    }
</script>

有疑惑的小伙伴,可能是我表达不清楚,可以留言讨论,如有错误,也希望大家不吝指出。
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐