hilongjw / vue-lazyload

A Vue.js plugin for lazyload your Image or Component in your application.
http://hilongjw.github.io/vue-lazyload/
MIT License
7.99k stars 865 forks source link

Click reloads all images #474

Open ghost opened 3 years ago

ghost commented 3 years ago

Hey got a small problem,

sometimes when I click an Img to get a selected border it reloads all images, is this a bug or can I disable it somehow?

<div class="row pictures" v-lazy-container="{ selector: 'img' }">
  <div class="col-4 p-1" v-for="(filter, i) in pictures" :key="filter" :style="`--i: ${i}`">
    <div  @click="selected = i" class="card bg-secondary shadow-sm picture" :class="{'selected': selected === i}">
      <div class="card-body">
        <img class="img-fluid" :data-src="filter.src"/>
      </div>
    </div>
</div>

here a small recording: https://jmp.sh/6Jrjm2O

hope someone can help me :)

superdiazzz commented 2 years ago

I got same issue, any solution?

ghost commented 2 years ago

@superdiazzz i use this https://github.com/alexjoverm/v-lazy-image works fine.

superdiazzz commented 2 years ago

@superdiazzz i use this https://github.com/alexjoverm/v-lazy-image works fine.

I don't see placeholder image in this libs. Or you know how to do that?