Skip to content

Expose a reference of the underlying img HTMLElement #438

Description

@Rigo-m

Proposal

<nuxt-img /> and <nuxt-picture /> should expose in some way the underlying <img /> HTMLElement.

Why would I need this?

As pointed out here: Imgix blurhash issue, I'm displaying a blurhashed image on top of <nuxt-img />, and I need to un-show it either if the image has been loaded (i.e. it's already present because of cache) or after the onload event.
I've attached a ref to <nuxt-img /> and then I've searched for the <img /> element underneath to check image.complete attribute, but it feels a little bit clunky.
How can we handle this better?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions