Solve the problem that the uniapp project will be white screen when jumping to external links in WeChat using <web-view>

Let's not talk nonsense and talk about the code

<template>
	<!-- 授权页跳转页面 -->
	<web-view src="https://www.baidu.com/" :progress="false"></web-view>
</template>

In this way, there may be a white screen problem in WeChat, and nothing will appear on the screen.insert image description here

Analyze the reasons

This situation is mainly due to the use of the web-view tag, which is equivalent to building a container in WeChat, and jumping through this container, and then the page cannot be displayed if there is a problem with the container.

Solution

This is the more direct method I currently use. I don’t need this container directly, and use it directly to jump.

window.location.replace("https://www.baidu.com/")

at last

Ability is limited, hope to be able to help you.

Guess you like

Origin blog.csdn.net/Soncat2000/article/details/128624902