Skip to content

feat: emit native <img> events - #416

Merged
pi0 merged 6 commits into
nuxt:mainfrom
hansds:feat/image-load-event
Oct 8, 2021
Merged

feat: emit native <img> events#416
pi0 merged 6 commits into
nuxt:mainfrom
hansds:feat/image-load-event

Conversation

@hansds

@hansds hansds commented Sep 14, 2021

Copy link
Copy Markdown
Contributor

nuxt-image now emits the onLoad event from the contained image

@shadow81627

Copy link
Copy Markdown
Contributor

Use $listeners to allow binding to all native events. https://vuejs.org/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components

@hansds

hansds commented Sep 14, 2021

Copy link
Copy Markdown
Contributor Author

Use $listeners to allow binding to all native events. https://vuejs.org/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components

Thanks for the suggestion! I updated the PR.

@shadow81627

Copy link
Copy Markdown
Contributor

It would be nice to have a test for the on load event. The docs and playground could also be updated to include the onload event.

Comment thread src/runtime/components/nuxt-img.vue Outdated
@hansds

hansds commented Sep 23, 2021

Copy link
Copy Markdown
Contributor Author

Hey @pi0 and @shadow81627 - I fixed your suggestions. Added docs, playground, nuxt-picture and an e2e test.
For the e2e test I wasn't too sure what the best approach was, I opted for verifying a console message, but maybe there's a better way?

@hansds
hansds requested a review from pi0 October 7, 2021 12:37

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pi0 pi0 changed the title feat: emit on image load event for nuxt-img feat: emit native <img> events Oct 8, 2021
@pi0
pi0 merged commit f22ae01 into nuxt:main Oct 8, 2021
@provokcx

Copy link
Copy Markdown

@pi0 Do you know when you will release those changes?

@madsh93

madsh93 commented Dec 1, 2021

Copy link
Copy Markdown

@pi0 When will this be released? Docs are live, but @load is still not working on latest version.

@evangelinepapanicola

Copy link
Copy Markdown

@load still doesn't seem to work with nuxt-picture in the latest version. According to the docs this should work - might be worth updating them as it is misleading.

@baptistebriel

Copy link
Copy Markdown

Would be great to have @load event on <nuxt-picture> 👍🏻

procrates pushed a commit to procrates/nuxt-image that referenced this pull request Feb 21, 2023
@github-actions github-actions Bot mentioned this pull request Jul 30, 2026
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

Successfully merging this pull request may close these issues.

7 participants