【发布时间】:2019-08-29 01:03:39
【问题描述】:
资产目录中的图像和 svg 未显示在 ionic serve 中。似乎资产文件夹在构建期间没有复制到 www 目录中。
我的项目目录结构是:
-src
--app
--资产
---图标
---svg
--环境
--主题
我已经尝试调整图像和 svg 的 src 位置。但似乎它们都不起作用!
我已经尝试过的路径:
评估/
/资产/
./assets/
../assets/
../../assets/
控制台错误提示:
GET http://localhost:8100/icon/cash-round.png 404(未找到)
GET http://localhost:8100/svg/md-apps.svg 404(未找到)
GET http://localhost:8100/svg/md-send.svg 404(未找到)
这里是html文件的代码:
<ion-header>
<ion-toolbar>
<ion-title>
<img src="icon/cash-round.png"> Welcome
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card class="welcome-card">
<ion-card-header>
<ion-card-subtitle>Get Started</ion-card-subtitle>
<ion-card-title>Welcome to Ionic</ion-card-title>
</ion-card-header>
<ion-card-content>
<p>Now that your app has been created, you'll want to start building out features and components. Check out some of the resources below for next steps.</p>
<button id="demo">Click me</button>
</ion-card-content>
</ion-card>
</ion-content>
如果我必须安装任何包来显示图像或其他文件(如 package.json 或 angular.json)中的更改,请告诉我
【问题讨论】:
标签: angular ionic-framework ionic2 ionic3 ionic4