uniapp 从当前网页跳转到外部网页
不同地址之间的网页跳转,切换方法。
·
需求描述
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>
有疑惑的小伙伴,可能是我表达不清楚,可以留言讨论,如有错误,也希望大家不吝指出。
更多推荐
已为社区贡献12条内容
所有评论(0)