javascript - vue lazy loading plug-in pictures are not updated
phpcn_u1582
phpcn_u1582 2017-06-12 09:20:53
0
2
633

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: []
}
phpcn_u1582
phpcn_u1582

reply all(2)
给我你的怀抱

I have never used this component. I suggest you go to issues to ask questions, https://github.com/lzxb/vue-l...

phpcn_u1582

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template