javascript - “webview”不是电子角度应用程序中的已知元素
问题描述
我正在使用电子创建桌面应用程序。我们需要加载网页并与网页交互。
我们开始知道电子有什么标签
根据文档,这是我们的main.js文件配置
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
webviewTag: true <--------------- as said by the documentation
}
})
现在是我们添加了这个标签的webpage.component.html文件
<webview src="https://www.github.com/"></webview>
这是我们的web-page.component.ts文件
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'webpage',
templateUrl: './webpage.component.html',
styleUrls: ['./webpage.component.scss']
})
export class WebpageComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
但是我们一次又一次地收到这个错误,我们不知道我们做错了什么!
ERROR in src/app/webpage/webpage.component.html:1:1 - error NG8001: 'webview' is not a known element: 1. If 'webview' is an Angular component, then verify that it is part of this module. 2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. 1 <webview src="https://www.github.com/"></webview> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/app/webpage/webpage.component.ts:5:16 5 templateUrl: './webpage.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component WebpageComponent.
想知道我们做错了什么!
解决方案
推荐阅读
- android - Firebase实时数据库getvalue()未映射对象
- python - 简单的 ping 扫描程序可以运行但也有错误
- bash - 部署和 ConfigMap 有什么关系?
- reactjs - 如何以网格布局显示视频并在按下 React Native 时播放
- graphql - 如何验证或检测 graph-ql java 中的附加请求参数?
- android - “R”或“资源”在 Android Studio 中给我错误
- python - 如何通过点击而不是语音触发 Alexa 意图?
- json - json 文件在网页上的“< >”内不显示字符串(例如“abc
") - spring - 无法解析原型
- android - Flutter 永久隐藏导航栏