vue-lazyload icon indicating copy to clipboard operation
vue-lazyload copied to clipboard

how to set error image

Open Jesonhu opened this issue 7 years ago • 5 comments

i use like this 1 main.js中配置

import Vue from 'vue'
import VueLazyload from 'vue-lazyload' // 懒加载
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: 'http://hilongjw.github.io/vue-lazyload/dist/404.png',
  loading: './assets/loading-spin.svg',
  attempt: 1,
  listenEvents: [ 'scroll' ],
  adapter: {
    loaded (listener, fromCache, Init) {
    },
    loading (listener, Init) {
      console.log('Lazy loading')
    },
    error (listener, Init) {
      console.log('Lazy error')
    }
  }
})

2 具体使用懒加载的页面

<img class="img"
           v-lazy="item.listPic"
           :alt="item.name">

某个src图片加载失败后显示

<img data-v-28336d0f="" alt="11乐在棋中——校园棋艺大赛" class="img" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" lazy="error">

我怎么修改让自定义的错误图片显示出来呢?

Jesonhu avatar Jul 04 '17 09:07 Jesonhu

What version are you currently using?

hilongjw avatar Jul 06 '17 03:07 hilongjw

vue-lazyload: 1.0.5

vue: 2.3.3

pc: window 10 专业版64位

Jesonhu avatar Jul 06 '17 04:07 Jesonhu

i have the same issue. when src is not found, error handle image cant show

sprabowo avatar Feb 19 '18 16:02 sprabowo

请问你解决了吗 我也遇到了这样的问题

zyp-zhang avatar Aug 01 '19 04:08 zyp-zhang

same issue!

demyan1411 avatar Dec 04 '19 12:12 demyan1411