ios - Headless webview
问题描述
Is there a way to create a headless WebView instance in Nativescript (Vue) for use with nativescript-webview-interface (which expects a Nativescript view)? How can I instantiate the Vue component so it creates the native webview in the background (similar to document.createElement
on web)?
解决方案
尝试创建元素的核心方式
import { WebView } from "tns-core-modules/ui/web-view";
...
methods: {
createWebView: function() {
const webView = new WebView();
// Remember to pass in context in case of android
wv._setupAsRootView({});
wv.onLoaded();
...
}
}
...
推荐阅读
- r - 在 Jupyter Lab 中从 Rmarkdown .Rmd 文件运行 R 代码时如何调整绘图大小?
- python - 通过气流中的文件观察器触发 dag
- amazon-web-services - 无法使用 Amazon Linux 2 在 Lightsail 实例中安装 CodeDeploy
- angular - 如何在打字稿中从cdn脚本执行函数
- javascript - react-navigation 导航钩子类型
- angular - 单击Angular更改项目的颜色
- firebase - 在 Firebase 中检索 API 密钥
- google-apps-script - 通过勾选复选框自动移动 Google 表单响应
- c++ - 当缓存线大小通常为 64 字节时,为什么 sizeof std::mutex == 40
- python - python re.split 与 maxsplit 参数