hilongjw / vue-lazyload

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

[Vue warn]: Failed to resolve directive: lazy #300

Open wdlhao opened 6 years ago

wdlhao commented 6 years ago

页面中使用,提示没有这个指令

gebin commented 6 years ago

同样遇到该问题,在webpack环境中没问题,打包之后运行报错

pdt590 commented 5 years ago

I had same issue on Vue 2.5.18

nyz123 commented 5 years ago

guys,你们怎么解决的呀?我在用youzan的vant,报这个错误?how to fix it?

nyz123 commented 5 years ago

guys,你们怎么解决的呀?我在用youzan的vant,报这个错误?how to fix it?

我的问题解决了,方法如下:

import Vant,{Lazyload} from 'vant';
Vue.use(Lazyload)
Vue.use(Vant);
BruceWang99 commented 5 years ago

就不能局部注册组件吗 我每个组件loading的图都不是一样的

BruceWang99 commented 5 years ago

v-lazy={ src: 'http://xx.com/logo.png', error: 'http://xx.com/error.png', loading: 'http://xx.com/loading-spin.svg' }

CavalcanteLeo commented 3 years ago

i'm getting this error 3 years after the first issue, this lib is clearly not ready for production

LiHongxiang1993 commented 2 years ago

2022 already half, the fly of time!I also have the problem // main.ts import Vue from 'vue' import '../init' import App from './App.vue' import Frog from '../directives/frog' import VueLazyload from 'vue-lazyload'

Vue.use(VueLazyload) Vue.directive('frog', Frog)

new Vue({render: h => h(App)}).$mount('#bd')

hagyao520 commented 2 years ago

image 有人能解决下吗@caozhong1996

xu-wanpeng commented 2 years ago

图片 有人能解决下吗@caozhong1996

先卸载vue-lazyload 再 npm install vue-lazyload@1.3.3

qunbotop commented 2 years ago

十分感谢!解决了