o***@126.com
o***@126.com
  • 发布:2021-09-03 19:13
  • 更新:2021-09-05 01:43
  • 阅读:880

如何覆盖web-view组件

分类:uni-app
<template>  
    <view>  
        <div class="test">123</div>  
        <web-view src="https://www.hao123.com"></web-view>  
    </view>  
</template>  

<style>  
    .test{  
        position: fixed;  
        top:100px;  
        z-index: 9999;  
    }  
</style>

请问上面div为什么不能覆盖web-view,该如何覆盖呢

2021-09-03 19:13 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com

webview 是追加在当前页面上的,当前页面也是一个webview ,所以你添加的div是当前页面的。而不是追加上的webview ,我们叫子webview 。你可以这样,用api获取子webview,然后用h5+在子webview上绘制一个div就搞定了。

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