vant icon indicating copy to clipboard operation
vant copied to clipboard

[Feature Request] fetchpriority on van-image

Open tintin10q opened this issue 1 year ago • 1 comments

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">

tintin10q avatar Jan 17 '25 06:01 tintin10q

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

inottn avatar Jan 17 '25 11:01 inottn