/ohos5.0/docs/zh-cn/application-dev/performance/ |
H A D | avoid_high_frequency_callback_execute_lengthy_operation.md | 7 …itemGenerator,keyGenerator,getData中执行耗时操作。** 例如,在懒加载滑动场景中,框架会根据滚动容器可视区域按需创建组件,所以在滑动时框架会频繁调用子组件生成函数… 148 ## 避免在LazyForEach的itemGenerator,keyGenerator,getData中执行耗时操作 190 // itemGenerator入参函数 192 console.log("Scenario 3 itemGenerator,item:" + item); 254 …itemGenerator,keyGenerator。因为滑动时框架会对比item键值,判断是使用缓存节点还是新建节点。因此会先调用getData获取索引位置的数据,并提供给keyGenerato… 258 ### 避免在LazyForEach的itemGenerator中执行耗时操作 262 在itemGenerator入参函数中执行耗时操作。 419 由于上述itemGenerator,keyGenerator,getData滑动场景中正反例的对比效果类似,所以下面只给出itemGenerator正反例的效果对比。 421 图6 itemGenerator中执行耗时操作的滑动效果 425 图6是在itemGenerator入参函数中执行耗时操作的滑动效果,可以明显看出滑动时存在卡顿,item节点刷新慢等问题。 [all …]
|
H A D | list-perf-improvment.md | 28 itemGenerator: (item: Object, index: number) => void, // 子组件生成函数 38 itemGenerator: (item: Object, index: number) => void, // 子组件生成函数
|
/ohos5.0/docs/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ |
H A D | ts-rendering-control-lazyforeach.md | 11 LazyForEach(dataSource: IDataSource,itemGenerator: (item: any, index: number) => void,keyGenerator?… 24 …itemGenerator | (item: Object, index: number) => void | 是 | 子组件生成函数,为数组中的每一个…
|
H A D | ts-rendering-control-foreach.md | 13 ForEach(arr: Array\<any\>,itemGenerator: (item: any, index: number) => void,keyGenerator?: (item: a… 28 | itemGenerator | (item: Object, index: number) => void | 是 | 组件生成函数。<br/>- 为数组中的每个元素创建对应的组件。<b… 33 > - `ForEach`的`itemGenerator`函数可以包含`if/else`条件渲染逻辑。另外,也可以在`if/else`条件渲染语句中使用`ForEach`组件。
|
H A D | ts-rendering-control-repeat.md | 45 each(itemGenerator: (repeatItem: RepeatItem\<T\>) => void): RepeatAttribute\<T\> 52 > `itemGenerator`的参数为`RepeatItem`,该参数将`item`和`index`结合到了一起,请勿将`RepeatItem`参数拆开使用。
|
/ohos5.0/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/jsview/ |
H A D | js_lazy_foreach.cpp | 189 JSRef<JSFunc> itemGenerator = JSRef<JSFunc>::Cast(params[PARAM_ITEM_GENERATOR]); in Create() local 212 actuator->SetItemGenerator(itemGenerator, std::move(keyGenFunc)); in Create()
|
/ohos5.0/docs/en/application-dev/reference/apis-arkui/arkui-ts/ |
H A D | ts-rendering-control-foreach.md | 18 | itemGenerator | (item: Object, index: number) => void | Yes | Component generator.<br>- It gen… 23 > - The **itemGenerator** function can contain an **if/else** statement, and an **if/else** stateme…
|
H A D | ts-rendering-control-lazyforeach.md | 20 …itemGenerator | (item: Object, index: number) => void | Yes | Child component generation fun…
|
H A D | ts-rendering-control-repeat.md | 33 each(itemGenerator: (repeatItem: RepeatItem\<T\>) => void): RepeatAttribute\<T\> 40 - The parameter of **itemGenerator** is **RepeatItem**, which combines **item** and **index**. Do n…
|
/ohos5.0/docs/zh-cn/application-dev/quick-start/ |
H A D | arkts-rendering-control-foreach.md | 17 ArkUI框架对于`ForEach`的键值生成有一套特定的判断规则,这主要与`itemGenerator`函数的第二个参数`index`以及`keyGenerator`函数的第二个参数`index`… 28 在确定键值生成规则后,ForEach的第二个参数`itemGenerator`函数会根据键值生成规则为数据源的每个数组项创建组件。组件的创建包括两种情况:[ForEach首次渲染](#首次渲染)和[… 512 - 对于以上限制规则,`index`参数存在的意义为:index是开发者保证键值唯一性的最终手段;对数据项进行修改时,由于`itemGenerator`中的`item`参数是不可修改的,所以须用in…
|
H A D | arkts-observed-and-objectlink.md | 609 …1. ForEach:数组项的赋值导致ForEach的[itemGenerator](../reference/apis-arkui/arkui-ts/ts-rendering-control-f… 613 …1. ForEach:新添加的Info对象对于ForEach是未知的[itemGenerator](../reference/apis-arkui/arkui-ts/ts-rendering-co…
|
H A D | arkts-rendering-control-lazyforeach.md | 27 在确定键值生成规则后,LazyForEach的第二个参数`itemGenerator`函数会根据组件创建规则为数据源的每个数组项创建组件。组件的创建包括两种情况:[LazyForEach首次渲染](… 1115 …位于该子组件对应的数据项之后的各数据项,其`index`均应减1,但实际上后续的数据项对应的子组件仍然使用的是最初分配的`index`,其`itemGenerator`中的`index`并没有发生…
|
/ohos5.0/docs/en/application-dev/quick-start/ |
H A D | arkts-rendering-control-foreach.md | 17 …ch are mainly associated with the second parameter **index** of the **itemGenerator** function and… 28 After the key generation rules are determined, the **itemGenerator** function – the second paramete… 509 …x value to modify the data source because the **item** parameter in **itemGenerator** cannot be mo…
|
H A D | arkts-rendering-control-lazyforeach.md | 27 After the key generation rules are determined, the **itemGenerator** function – the second paramete… 1115 … If these data items still use the original indexes, the indexes in **itemGenerator** do not chang…
|
H A D | arkts-observed-and-objectlink.md | 609 …1. **ForEach**: The value assignment of the array item causes the change of [itemGenerator](../ref… 613 …1. **ForEach**: The newly added **Info** object is unknown to the **ForEach** [itemGenerator](../r…
|
/ohos5.0/docs/zh-cn/release-notes/api-diff/v4.0-Release to v3.2-Release/ |
H A D | js-apidiff-arkui.md | 2098 …itemGenerator: (item: any, index: number) => void,<br> keyGenerator?: (item: any, index: number… 2329 …itemGenerator: (item: any, index: number) => void,<br> keyGenerator?: (item: any, index: number…
|
/ohos5.0/docs/en/release-notes/api-diff/v4.0-Release-vs-v3.2-Release/ |
H A D | js-apidiff-arkui.md | 2098 …itemGenerator: (item: any, index: number) => void,<br> keyGenerator?: (item: any, index: number… 2329 …itemGenerator: (item: any, index: number) => void,<br> keyGenerator?: (item: any, index: number…
|