For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/components/media/long-image.md.

long-image

长图加载与展示组件,支持分段懒加载,适用于超长图片的高性能渲染。

扫码预览

扫码预览 long-image

Props

属性名类型默认值必填说明
classNamestring-否组件类名。
decodeOverscanScreensnumber1否解码窗口的预加载屏数,基于当前可视区域高度计算。
idstring-否元素唯一标识。未传时内部自动生成。
maxActiveSegmentsnumber8否解码窗口允许同时激活的最大分段数。
用于控制单次内存峰值。
onMetricsChange(metrics: LongImageMetrics) => void-否指标回调,输出尺寸和当前激活窗口信息。
onStateChange(state: LongImageState) => void-否状态回调,输出阶段与错误信息。
placeholderColorstring'transparent'否非激活分段或分段图片加载失败时的占位背景色。
reloadTokennumber0否手动重建分段与解码窗口的触发令牌。值变化时会重新初始化。
scrollEventThrottlenumber60否滚动事件回调节流时间(ms)。
segmentDisplayHeightnumber600否单段在展示坐标系下的目标高度(px)。
值越大,单次解码像素越大;值越小,分段数量越多。
srcstring-是图片资源地址。
styleCSSProperties-否组件样式。
- style.height:建议显式指定;未指定时默认使用 100vh。
- style.width:未指定时默认使用 100%。