Used to display images
auto-size2.6
When set to true and the
<image>
element has no width or height,
the size of the
<image>
will be automatically adjusted
to match the image's original dimensions after the image is successfully loaded,
ensuring that the aspect ratio is maintained.
autoplay2.11
Specifies whether the animated image should start playing automatically once it is loaded.
blur-radius0.2
Image blur radius
cap-insets1.4
Stretchable area for 9patch images, in percentage or decimal, four values for top, right, bottom, left
cap-insets-scale1.4
Adjust the scale of stretchable area for 9patch images
defer-src-invalidation2.7
When set to true, the
<image>
will only clear the previously displayed image resource after a new image has successfully loaded.
The default behavior is to clear the image resource before starting a new load.
This can resolve flickering issues when the image src is switched and reloaded. It is not recommended to enable this in scenarios where there is node reuse in views like lists.
image-configARGB_8888: 32-bit memory per pixel, supports semi-transparent images RGB_565: 16-bit memory per pixel, reduces memory usage but loses transparency Support PC platform since 3.5
loop-count1.4
Number of times an animated image plays, 0 stands for infinite
mode0.2
Specifies image cropping/scaling mode scaleToFill: Scales the image without preserving the aspect ratio, stretching the image to fill the element aspectFit: Scales the image while preserving aspect ratio so that the long side is fully visible aspectFill: Scales the image while preserving aspect ratio, ensuring the short side fills the element center: Does not scale the image; image is centered
placeholder1.4
Placeholder image, used same as src
prefetch-heightImage won't load if its size is 0, but will load if prefetch-height is set
prefetch-widthImage won't load if its size is 0, but will load if prefetch-width is set
src0.2
Supports http/https/base64
tint-colorChanges the color of all non-transparent pixels to the tint-color specified. The value is a
<color>
.
Frontend can bind corresponding event callbacks to listen for runtime behaviors of the element, as shown below.
binderror0.2
Image load error event
bindload0.2
Image load success event
Frontend can invoke component methods via the SelectorQuery API.
pauseAnimation2.11
Pauses the animation, without resetting the loop-count.
resumeAnimationResumes the animation, without resetting the loop-count.
startAnimateRestart the animation playback method controlled by the front end, and the animation playback progress and loop count will be reset.
stopAnimationStops the animation, and it will reset the loop-count.