提交 5e302dd6 编写于 作者: G guozejun

Recycle doc.

Signed-off-by: Nguozejun <guozejun@huawei.com>
Change-Id: I4c85beae883ac20086622f58cf5fd81be977d65d
上级 2c959dc0
......@@ -114,6 +114,19 @@ struct ParentComponent {
}
```
- \@Recycle:\@Recycle装饰的自定义组件具备可复用能力
> **说明:**
>
> 从API version 10开始,该装饰器支持在ArkTS卡片中使用。
```ts
@Recycle
@Component
struct MyComponent {
}
```
## 成员函数/变量
......
......@@ -113,6 +113,19 @@ onMeasure?(children: Array&lt;LayoutChild&gt;, constraint: ConstraintSizeOptions
| children | Array&lt;[LayoutChild](#layoutchild9)&gt; | 子组件布局信息。 |
| constraint | [ConstraintSizeOptions](ts-types.md#constraintsizeoptions) | 父组件constraint信息。 |
## onRecycle<sup>10+</sup>
onRecycle?(params: { [key: string]: unknown }): void
当一个可复用的自定义组件从复用缓存中重新加入到节点树时,触发onRecycle生命周期回调,并将组件的构造参数传递给onRecycle。
从API version 10开始,该接口支持在ArkTS卡片中使用。
**参数:**
| 参数名 | 类型 | 说明 |
| ------ | -------------------------- | -------------------- |
| params | { [key: string]: unknown } | 自定义组件的构造参数 |
## LayoutChild<sup>9+</sup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册