2***@qq.com
2***@qq.com
  • 发布:2020-04-15 07:33
  • 更新:2025-09-17 16:39
  • 阅读:4417

使用uni做的h5已经在index.html加入了un.webview.js但是无法使用getEnv等方法

分类:uni-app

因为架构需要,有几个页面使用uni-app做了h5页面,在uniapp做的app里面使用webview嵌套。
根据官方的要求,我已经另外配置了h5项目的index.html
但是,运行以后在控制台甚至直接输出却存在uni.getEnv()等方法,h5页面就没法跟webview实现交互
大家有什么好的办法

uni.getEnv()  
VM7154:1 Uncaught TypeError: uni.getEnv is not a function  
    at <anonymous>:1:5
0 关注 分享

要回复文章请先登录注册

2***@qq.com

2***@qq.com (作者)

解决了,原来官方把通信方法放在了webview下,
2020-04-15 10:26
9***@qq.com

9***@qq.com

老师好
2020-04-15 08:19