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

[Feature Request] fetchpriority on van-image #13315

Open
tintin10q opened this issue Jan 17, 2025 · 1 comment
Open

[Feature Request] fetchpriority on van-image #13315

tintin10q opened this issue Jan 17, 2025 · 1 comment

Comments

@tintin10q
Copy link

What problem does this feature solve?

It would be great if you could set fetchpriority on van-image components.
Currently this does not work. This property makes the browser fetch images earlier or later with when set on images.
This can be very useful.

The possible values would be:

type fetchpriority = "low" | "high" | "auto"

Here is more info on fetchPriority. https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority and https://addyosmani.com/blog/fetch-priority/

What does the proposed API look like?

<van-image fetchpriority="high" src="https://fastly.jsdelivr.net/npm/@vant/assets/logo.png">
@inottn
Copy link
Collaborator

inottn commented Jan 17, 2025

Thanks for your feedback, I will add it in the next version.

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