Using these two plug-ins
lazy-load-img
vue-lazy-load-img
When new data replaces the original goodsList, the lazy-loaded pictures remain unchanged. Know how to deal with it
<p v-for="item in goodsList">
<vue-lazy-load-img
mode="diy"
:time="50"
:complete="true"
:position="{ top: 0, right: 0, bottom: 0, left: 0 }"
:diy="{ backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: 'center center' }"
@before="before"
@success="success"
@error="error">
<img
:src="'../image/load-img.png'"
:src="item.thumb_img">
</vue-lazy-load-img>
</p>
<script src="../script/lazy-load-img.js"></script>
<script src="../script/vue-lazy-load-img.js"></script>
data: {
goodsList: []
}
I have never used this component. I suggest you go to issues to ask questions, https://github.com/lzxb/vue-l...
I also used lazy loading of images in my project, but it is not this component. You can refer to the component I used, so that your situation will not happen.
The images in the project are lazy loaded