Android Nativescript应用程序-在Webview中加载本地HTML/JS/CSS
如果我想在Webview中显示本地html文件,我该怎么做 尝试过的解决方案:Android Nativescript应用程序-在Webview中加载本地HTML/JS/CSS,android,webview,nativescript,Android,Webview,Nativescript,如果我想在Webview中显示本地html文件,我该怎么做 尝试过的解决方案: 我要在webview中显示的各个html的绝对路径,如下所示: 像这样编辑webpack.config.js: 这里提到了这个解决方案: 新建CopyWebpackPlugin([ {from:{glob:“monitrodaten/webview/assets/**”},您的路径缺少“app” 或 网页包配置 { from: { glob: "app/monitrodaten/webview
- 我要在webview中显示的各个html的绝对路径,如下所示:
- 像这样编辑webpack.config.js:
这里提到了这个解决方案:
新建CopyWebpackPlugin([
{from:{glob:“monitrodaten/webview/assets/**”},您的路径缺少“app”
或
网页包配置
{ from: { glob: "app/monitrodaten/webview/assets/**"} }
<Webview #myWebView [src]="htmlPath" ></Webview>
new CopyWebpackPlugin([
{ from: { glob: "monitrodaten/webview/assets/**"} }, <= Added this row
{ from: { glob: "fonts/**" } },
{ from: { glob: "**/*.jpg" } },
...
this.htmlPath = encodeURI(`${fs.knownFolders.currentApp().path}/app/monitordaten/webview/assets/graph.html`);
this.htmlPath = encodeURI(`~/app/monitordaten/webview/assets/graph.html`);
{ from: { glob: "app/monitrodaten/webview/assets/**"} }