【发布时间】:2021-09-25 15:56:10
【问题描述】:
我正在使用 Ionic Angular 框架构建一个移动应用程序,并希望支持 webp 图像作为主图像,如果不支持,我希望显示备用图像。
它适用于img
<picture>
<source srcset="assets/images/hello.webp" type="image/webp" />
<img src="assets/images/hello.png" alt="Hello image" />
</picture>
但它不适用于ion-img。它总是在此处显示后备 png 图片。
<picture>
<source srcset="assets/images/hello.webp" type="image/webp" />
<ion-img src="assets/images/hello.png" alt="Hello image"></ion-img>
</picture>
【问题讨论】:
标签: html angular image ionic-framework