【发布时间】:2021-12-23 02:11:11
【问题描述】:
我正在使用 vue swiper - https://swiperjs.com/vue,我基本上有一个带有 Lazy 模块的垂直 swiper,因此我的幻灯片中的图像以惰性方式加载。我的代码很简单:
<Swiper>
<SwiperSlide>
<div class="flex items-center gap-5">
<div class="overflow-hidden rounded-full w-14 h-14">
<img
:data-src="/image.png"
:data-srcset="/image.png 2x"
class="object-cover w-full h-full swiper-lazy"
>
</div>
<div class="flex flex-col col-span-3">
<p class="text-sm font-medium text-gray-900"> Title </p>
<p class="text-xs text-gray-600"> Subtitle </p>
</div>
</div>
</SwiperSlide>
</Swiper>
我注意到,每次我的滑动器滑动(自动或手动)时,图像都会在开始时出现一些奇怪的灰色“边框”,最终被图像替换。但是,如果我删除 src 和 srcset 参数,“边框”仍然存在,无论图像是否圆润。幻灯片如下所示:
我检查了所有可能的 CSS 配置,但实际上什么都没有——没有边框、轮廓、框阴影或类似的东西。有没有人遇到过这样的问题,请问如何解决?
【问题讨论】:
标签: javascript css swiper