星聚客
星聚客
  • 发布:2020-10-15 17:52
  • 更新:2020-10-15 18:31
  • 阅读:723

【报Bug】web-view 在APP中报错 H5正常

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: W10

HBuilderX类型: 正式

HBuilderX版本号: 2.9.3

手机系统: iOS

手机系统版本号: iOS 13.4

手机厂商: 苹果

手机机型: 6S

页面类型: vue

打包方式: 离线

项目创建方式: HBuilderX

示例代码:
<template>  
  <view>  
    <web-view src="https://www.baidu.com/"/>  
  </view>  
</template>  

<script>  
  export default {  
    name: 'webView',  
    data(){  
      return {  
        src: ''  
      }  
    },  
    onLoad({src, title}){  
      if (!this.src) {  
        this.src = src  
      }  
    }  
  }  
</script>

操作步骤:

直接报错

预期结果:

???

实际结果:

APP白屏 报错
H5 正常

bug描述:

就是普通的web -view 报错

[Vue warn]: Error in beforeCreate hook: "TypeError: undefined is not an object (evaluating 'r.data.attrs._i')"
17:39:29.973 found in
17:39:30.005 ---> <WebView> at pages/webView.vue:1 ERROR
17:39:30.037 TypeError: undefined is not an object (evaluating 'r.data.attrs._i') __ERROR
17:39:30.069 [Vue warn]: Error in beforeCreate hook: "TypeError: undefined is not an object (evaluating 'r.data.attrs._i')"
17:39:30.101 found in
17:39:30.132 ---> <WebView> at pages/webView.vue:1
ERROR
17:39:30.164 TypeError: undefined is not an object (evaluating 'r.data.attrs._i') ERROR
17:39:30.196 [Vue warn]: Error in beforeCreate hook: "TypeError: undefined is not an object (evaluating 'r.data.attrs._i')"
17:39:30.228 found in
17:39:30.260 ---> <WebView> at pages/webView.vue:1 __ERROR
17:39:30.292 TypeError: undefined is not an object (evaluating 'r.data.attrs._i')
ERROR
17:39:30.324 [Vue warn]: Error in beforeCreate hook: "TypeError: undefined is not an object (evaluating 'r.data.attrs._i')"
17:39:30.355 found in
17:39:30.387 ---> <WebView> at pages/webView.vue:1 ERROR
17:39:30.419 TypeError: undefined is not an object (evaluating 'r.data.attrs._i') __ERROR
17:39:30.451 [Vue warn]: Error in beforeCreate hook: "TypeError: undefined is not an object (evaluating 'r.data.attrs._i')"
17:39:30.482 found in
17:39:30.514 ---> <WebView> at pages/webView.vue:1
ERROR
17:39:30.545 TypeError: undefined is not an object (evaluating 'r.data.attrs._i') __ERROR
17:39:30.577 [Vue warn]: Error in beforeCreate hook: "TypeError: undefined is not an object (evaluating 'r.data.attrs._i')"
17:39:30.609 found in

2020-10-15 17:52 负责人:无 分享
已邀请:
星聚客

星聚客 (作者)

已解决

不能写

name: 'webView',

该问题目前已经被锁定, 无法添加新回复