问题描述
如下代码:
<img :src=soundSvg alt="" style="width: 100%; height: 100%;" />
data() {
return {
soundSvg: '../../static/auto-fill-component/icon_media_microphone.svg',
};
},
引入的图片能在web浏览器或uniapp内置web浏览器中正常显示,但在移动端不能正常显示。
解决方案
参考uniapp官方文档:
将img标签更改为image即可解决:
<image :src=soundSvg alt="" style="width: 100%; height: 100%;" />
详见官方文档: