使用了这两个插件
lazy-load-img
vue-lazy-load-img
当有新数据替换掉原有的goodsList后,懒加载的图片不变,不知道怎么处理
<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: []
}