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

Is there a way to prevent console logging 404 error? #497

Open
summerset-zz opened this issue Aug 17, 2022 · 0 comments
Open

Is there a way to prevent console logging 404 error? #497

summerset-zz opened this issue Aug 17, 2022 · 0 comments

Comments

@summerset-zz
Copy link

I've already tried this:

    app.use(VueLazyload, {
        preload: 1,
        error: LAZY_ERROR,
        loading: LAZY_LOADING,
        attempt: 3,
        dispatchEvent: true,
        adapter: {
            error(listener, Init) {
                console.log(listener);
            },
        },
    });

but in arguments of error adapter I found no way to stop it.

and I also tried to add @error="errorHandler" to the <img> element. I can catch the event, but e.preventDefault() has no use:

const errorHandler = (e: CustomEvent<any>) => {
    e.preventDefault();
    console.log(e)
}
// the type of 'e' is 'ReactiveListener'

currently using vue 3.2.37, vue-lazyload 3.0.0-rc.2

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

No branches or pull requests

1 participant