el-image组件可以通过设置error属性来指定默认图片,当图片加载失败时,就会显示error属性指定的默认图片。例如:

<el-image
  style="width: 100px; height: 100px;"
  src="https://www.example.com/image.png"
  error="https://www.example.com/default.png"
></el-image>

在上面的例子中,如果图片加载失败,则会显示https://www.example.com/default.png这张默认图片。

el-image如何设置默认图片

原文地址: https://www.cveoy.top/t/topic/cLww 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录