# image
渲染图片,不支持子组件、事件、方法
# 属性
支持通用属性
| 名称 | 类型 | 默认值 | 必填 | 描述 |
|---|---|---|---|---|
| src | <uri> | - | 否 | 图片的 uri,同时支持本地,支持的图片格式包括静态类型(png, svg) |
# SVG图片格式说明
# 支持的标签
<path> <rect> <circle> <ellipse> <line> <svg> <g> <animate> <animateColor> <aniamteTransform>
# 不支持的标签
<linearGradient> <radialGradient> <stop> <defs> <use> <text> <image> <polyline> <polygon> <clipPath> <desc> <marker> <mask> <solidColor> <switch> <symbol> <title> <view> <textPath> <tref> <tspan> <pattern>
# 支持的属性
svg:width height viewBox
style:fill opacity display fill-opacity stroke stroke-width stroke-opacity stroke-linecap stroke-linejoin stroke-miterlimit transform id
animate:attributeName attributeType type from to begin dur fill repeatCount
# 样式
支持通用样式
| 名称 | 类型 | 默认值 | 必填 | 描述 |
|---|---|---|---|---|
| object-fit | contain | cover | fill | none | scale-down | cover | 否 | 图片的缩放类型 |
object-fit ,参数列表如下:
| 类型 | 描述 |
|---|---|
| contain | 保持宽高比,缩小或者放大,使得图片完全显示在显示边界内,居中显示 |
| cover | 保持宽高比,缩小或者放大,使得两边都大于或等于显示边界,居中显示 |
| fill | 不保存宽高比,填充满显示边界 |
| none | 居中,无缩放 |
| scale-down | 保持宽高比,缩小或保持不变,取 contain 和 none中显示较小的一个,居中显示 |
# 属性
| 名称 | 类型 | 默认值 | 必填 | 描述 |
|---|---|---|---|---|
| id | <string> | - | 否 | 唯一标识 |
| style | <string> | - | 否 | 样式声明 |
| class | <string> | - | 否 | 引用样式表 |
| for | <array> | - | 否 | 根据数据列表,循环展开当前标签 |
| if | <boolean> | - | 否 | 根据数据 boolean 值,添加或移除当前标签 |
| src | <uri> | - | 是 | 图片的 uri,同时支持本地和云端路径,当前支持图片格式:png、svg |
# 样式
| 名称 | 类型 | 默认值 | 必填 | 描述 |
|---|---|---|---|---|
| width | <length> | - | 否 | 图片的宽度,不设置时使用图片原始的宽度 |
| height | <length> | - | 否 | 图片的高度,不设置时使用图片原始的高度 |
基础用法
```html
```
复制代码

设计尺寸:750X750
←
→
