riku
2024-11-07 5036880fc037e5d112206b93a729f60be12bf8ab
miniprogram_npm/tdesign-miniprogram/image/README.md
@@ -19,6 +19,12 @@
## 代码演示
<a href="https://developers.weixin.qq.com/s/wP7zUima7kSF" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> 在开发者工具中预览效果 </a>
<blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" >
<p>Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"</p>
</blockquote>
### 裁切样式
{{ base }}
@@ -39,14 +45,14 @@
  </p>
</details>
## API
### Image Props
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
t-id | String | - | `1.2.10`。图片标签id | N
error | String / Slot | 'default' | 加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败” | N
external-classes | Array | - | 组件类名,分别用于设置加载组件外层元素,中间内容等元素类名。`['t-class', 't-class-load']` | N
height | String / Number | - | 高度,默认单位为`px` | N
lazy | Boolean | false | 是否开启图片懒加载 | N
loading | String / Slot | 'default' | 加载态内容。值为 `default` 则表示使用默认加载中风格;值为其他则表示普通文本内容,如“加载中” | N
@@ -63,3 +69,20 @@
-- | -- | --
error | \- | 图片加载失败时触发
load | \- | 图片加载完成时触发
### Image 外部样式类
类名 | 说明
-- | --
t-class | 根节点样式类
t-class-load | 加载样式类
### CSS 变量
组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
--td-image-color | @font-gray-3 | -
--td-image-loading-bg-color | @bg-color-secondarycontainer | -
--td-image-loading-color | @font-gray-3 | -
--td-image-round-radius | @radius-default | -