Open kx59717 opened 7 years ago
@kimixu717 please confirm that the version you are using is the latest version (v1.0.5), in the previous version, there was this problem.
@hilongjw I have update vue-lazyload to 1.0.5, but bug still exist. You can see my website https://pwabeta4.banggood.com/index.php?com=shopcart&t=showCartProduct , turn to the homepage and add some product to the shopcart , then turn back to the posted site, wait util the product image loaded then check the checkbox , you will find that the loading image twinkled very fast.
It seems like choosing checkbox to cause Vue repeated rendering the shopping cart product, This is not the flash caused by vue-lazyload. Please make sure that the operation checkbox does not cause the <li class="main js_shopping_cart">
to be destroyed, and then created again.
vue-lazyload以图片地址做key,当再次遇到已加载的图片就可以避免已缓存的图片出现一闪而过的情形。
<img v-lazy="ImgSrc" :key="ImgSrc">
比如购物车,图片是用懒加载,而单选按钮本身是双向绑定的,此时,点击单选按钮更新了单选状态,可能是因为单选状态的属性和图片src属性是在一条数组数据里,数据更新造成图片也更新了一下数据,此时图片会闪烁,出现loading属性的图片然后恢复正常,闪的很快,快瞎了。