search

Home  >  Q&A  >  body text

javascript - vue lazy loading plug-in pictures are not updated

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_u1582phpcn_u15822817 days ago703

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-06-12 09:22:53

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

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-06-12 09:22:53

    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

    reply
    0
  • Cancelreply