Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance events in element #155

Closed
eugenioclrc opened this issue Jun 13, 2017 · 3 comments
Closed

enhance events in element #155

eugenioclrc opened this issue Jun 13, 2017 · 3 comments

Comments

@eugenioclrc
Copy link

Just a little examplo of something that would be really cool to have;

<img v-lazy="img" @error="errorHandler" />

@hilongjw
Copy link
Owner

@eugenioclrc Hi, This feature has been supported in 1.0.5

Vue.use(VueLazyload, {
    dispatchEvent: true
})

@eugenioclrc
Copy link
Author

Great!
Is there a reason for having the distpachEvent prop in false by default?

I was hacking a litle bit my code;

mounted() {
    this.$Lazyload.$on('error', (evt) => {
      this.$nextTick(() => {
        this.errorLoadingMyImage = evt.el === this.$refs.myImage;
      });
    });
  },

With the event my code will be cleaner, thanks and greate work!

@hilongjw
Copy link
Owner

At present, this feature's demand is relatively low frequency, I would like to default to false will be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants