问题:在vue 项目中,引入的图片无法在网页显示 控制台报错:图片地址 404 not found
解决方案:
把图片放在 static 文件夹,不要放在 assets 文件夹
index.html 代码:
<img src="./src/assets/img/logo.png" >
解决方案: 1. 把图片放在 static 文件夹,不要放在 assets 文件夹
我在 static 新建一个img 文件夹,并把 assets 文件夹中的图片搬了过去
2. 重新填写图片路径
<img src="static/img/logo.png" :onerror="defaultImg">
完整 index.html 代码
1.