收藏
回答

使用web-view,开发者工具与体验版都可以正常打开内嵌的h5页面,为什么线上版本无法打开?

后台已经正常配置业务域名,开发者工具也取消了不校验合法域名的选项
放在tabbar页面中同一域名下的web-view内嵌h5页面可以正常显示

通过传参赋值url的web-view页面就无法正常显示

<template>
	<web-view src="webUrl"></web-view>
</template>


<script>
	export default {
		data() {
			return {
				webUrl: '', 
			}
		},
		onLoad: function(option) {
			var that=this;
			let modifiedStr = option.url.replace(/!/g, '?').replace(/@/g, '=').replace(/#/g, '&');
			that.webUrl = modifiedStr;
		},
		methods: {


		},
		onShow() {


		},
	}
</script>
<style>
</style>
回答关注问题邀请回答
收藏

2 个回答

  • Guanine
    Guanine
    2025-08-28

    已解决,赋值url加了1秒的延迟就可以正常显示了

    2025-08-28
    有用 1
    回复 2
    • c
      c
      2025-09-13
      请问怎么解决的呢?直接加setTimeout吗?
      2025-09-13
      回复
    • Guanine
      Guanine
      2025-10-15回复c
      对,直接加setTimeout
      2025-10-15
      回复
  • 智能回答 智能回答 本次回答由AI生成
    2025-08-28
    有用
登录 后发表内容