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

[Avatar] Integration with Nuxt Image for built in image optimization #2078

Closed
GalacticHypernova opened this issue Aug 23, 2024 · 3 comments
Closed
Labels
enhancement New feature or request v3 #1289 wontfix-v2 This will not be fixed in `v2.x`.

Comments

@GalacticHypernova
Copy link

GalacticHypernova commented Aug 23, 2024

Description

For elements like UAvatar that use images, it would be a good idea to integrate with Nuxt Image for those who have it installed to benefit from image optimizations like setting image format, applying modifiers, and all the other features that Nuxt Image offers.

Additional context

No response

@GalacticHypernova GalacticHypernova added enhancement New feature or request triage labels Aug 23, 2024
Copy link
Member

benjamincanac commented Aug 23, 2024

Duplicate #1577.

You can already do this using the as prop of the Avatar component:

<script setup>
const NuxtImg = resolveComponent('NuxtImg')
</script>

<template>
  <UAvatar src="https://github.com/benjamincanac.png" :as="NuxtImg" />
</template>

@benjamincanac benjamincanac added duplicate This issue or pull request already exists and removed triage labels Aug 23, 2024 — with Volta.net
@benjamincanac benjamincanac closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
@GalacticHypernova
Copy link
Author

GalacticHypernova commented Aug 23, 2024

@benjamincanac
My apologies if it seemed as a duplicate, my suggestion was more so meant for automatic detection and usage of NuxtImg, not just plain capability (hence why I suggested integration as opposed to support). It would be a nice DX improvement in my opinion as it would simplify pages with a lot of avatars/other image elements.

@benjamincanac benjamincanac reopened this Sep 10, 2024
@benjamincanac benjamincanac removed the duplicate This issue or pull request already exists label Sep 10, 2024 — with Volta.net
@benjamincanac benjamincanac changed the title Integration with Nuxt Image for built in image optimization [Avatar] Integration with Nuxt Image for built in image optimization Sep 10, 2024
Copy link
Member

@GalacticHypernova Indeed, we could automatically use <NuxtImg> if installed. We can't do it yet in v3 because of #2141, we'll have to wait for a fix in Radix Vue first.

@benjamincanac benjamincanac added the v3 #1289 label Sep 10, 2024 — with Volta.net
@benjamincanac benjamincanac added the wontfix-v2 This will not be fixed in `v2.x`. label Nov 7, 2024 — with Volta.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3 #1289 wontfix-v2 This will not be fixed in `v2.x`.
Projects
None yet
Development

No branches or pull requests

2 participants