当前位置:首页 » 《资源分享》 » 正文

uni-app nvue vue3 setup中实现加载webview,解决nvue中获取不到webview实例的问题

25 人参与  2024年04月20日 17:38  分类 : 《资源分享》  评论

点击全文阅读


注意下面的方法只能在app端使用,

let wv = plus.webview.create("","custom-webview",{plusrequire:"none", 'uni-app': 'none', width: 300,height:400,top:uni.getSystemInfoSync().statusBarHeight+44 })wv.loadURL("https://www.baidu.com");let currentWebview = plus.webview.currentWebview();currentWebview.append(wv);;setTimeout(()=>{console.log(wv.getTitle(),wv.getURL())},1000)

效果

在这里插入图片描述

在这里插入图片描述

为什么不用标签的方式

这种方式拿不到实例啊,我搜了各种五花八门的方法始终都拿不到webview的实例

<web-view :fullscreen="false" ref="ref_webview" :style="{width: width,height:height}" :src="url" @load="load"></web-view> 

最近在开发aweb浏览器的手机版本,才用到webview。PC电脑的版本已经开发出来了。www.aweb123.com,使用electron开发的如果这个文章对你有帮助一定要下载下来玩玩啊。aweb浏览器官网


点击全文阅读


本文链接:http://zhangshiyu.com/post/98178.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1