像素方舟_青阳
像素方舟_青阳
  • 发布:2021-07-29 11:13
  • 更新:2021-08-11 16:24
  • 阅读:932

【报Bug】纯 nvue 下 plus.webview.create() 创建的weview 无法通过 append 跟随页面关闭

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: macOS Big Sur 11.2.3

HBuilderX类型: 正式

HBuilderX版本号: 3.1.22

手机系统: iOS

手机系统版本号: iOS 14

手机厂商: 苹果

手机机型: iPhone 12

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

页面A

<template>  
  <view class="content">  
    <text class="title" @click="onLink()">跳转</text>  
  </view>  
</template>  

<script>  
  export default {  
    methods: {  
      onLink() {  
        uni.navigateTo({  
          url: '/pages/web/index'  
        })  
      }  
    }  
  };  
</script>  

<style>  
  .content {  
    background: #fff;  
    flex: 1;  
  }  

  .title {  
    font-size: 36rpx;  
    color: #007AFF;  
  }  
</style>

页面B

<template>  
  <view class="page"></view>  
</template>  

<script>  
  export default {  
    onLoad() {  
      const page = this.$scope.$getAppWebview()  
      const web = plus.webview.create('https://baidu.com', 'custom', {  
        top: uni.getSystemInfoSync().statusBarHeight + 44,  
        bottom: 0,  
      })  
      page.append(web)  
      web.show()  
    },  
  };  
</script>  

<style>  
  .page {  
    background: #f5f5f5;  
  }  
</style>

操作步骤:

页面是 webview.nvue,内部通过 plus.webview.create 创建子webview,返回的时候,子webview 没有跟随关闭

预期结果:

跟随关闭

实际结果:

没有跟随关闭

bug描述:

纯 nvue 下 plus.webview.create() 创建的weview 设置了 this.$scope.$getAppWebview().append(wv) 无法跟随关闭

苹果和安卓都有这个问题

补充了demo工程和视频

2021-07-29 11:13 负责人:无 分享
已邀请:
chenli

chenli

去掉 web.show();// 这是导致没有跟随关闭的原因

把 this.$scope.$getAppWebview() 替换为 plus.webview.currentWebview()

chenli

chenli

ios模拟器没有复现出问题。
尝试修改把。parent.id改为其它字符串看看
const web = plus.webview.create('', 'custom-webview', { })javascript:;

像素方舟_青阳

像素方舟_青阳 (作者)

之前比较忙没有补充demo,现补充了demo项目,可供复现问题

像素方舟_青阳

像素方舟_青阳 (作者)

自己顶一下

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