Lines Matching refs:Repeat
1 # Repeat: Reusing Child Components
5 > Repeat is supported since API version 12.
7 For details about API parameters, see [Repeat APIs](https://gitee.com/openharmony/docs/blob/master/…
9 …Repeat**, used together with container components, renders repeated components based on the data s…
11 …Repeat** iterates data from the provided data source as required and creates the corresponding com…
15 - Repeat uses key value as identifiers. Therefore, **key()** must generate a unique value for each …
16 - **Repeat virtualScroll** must be used in the scrolling container component. Only the [List](../re…
17 …Repeat**, only one child component can be created in each iteration. Otherwise, there is no constr…
18 - When **Repeat** and custom component (or the @Builder function) are used together, the **RepeatIt…
19 …**virtualScroll** is enabled. If multiple template types are the same, **Repeat** overrides old **…
21 …Repeat** is used in a container component, only one **Repeat** can be contained. Take **List** as …
22 - When **virtualScroll** is enabled, the decorators of V1 are not supported in **Repeat**. Using th…
26 The purpose of **key()** is to allow **Repeat** to identify the details of array changes, including…
32 …hanges when the data item is moved, that is, the key changes. Therefore, Repeat considers that the…
37 **key()** can be left empty. **Repeat** will generate the default key.
39 
45 
51 All child components are created when **Repeat** is rendered for the first time. The original compo…
53 …Repeat** component updates data, it compares all keys in the last update with those in the latest …
55 …Repeat** compares all duplicate keys and reuses them, if the last key is unique and a new key is g…
57 … child components is less than the number of newly updated components, **Repeat** will create comp…
59 
63 At the first time when **Repeat** renders child components, only the required component is generate…
69 
71 …Repeat** component has two types of templateId. **templateId a** sets three as its maximum cache v…
73 
75 … component, coming up with a result of **templateId b**. In this case, **Repeat** obtains a node f…
77 …re are four nodes in the cache pool, which exceeds the rated three, so **Repeat** will release the…
79 
83 
87 
89 Now, **Repeat** notifies the parent component to re-lay out the nodes and compares the keys one by …
91 
95 
103 - When **totalCount** is greater than **arr.length**, Repeat renders **totalCount** list items, and…
111 **cachedCount** indicates the maximum number of subnodes that can be cached in the **Repeat** cache…
113 …ount()** of the scrolling container component and **cachedCount()** of **Repeat**. Both are used t…
115 …st** or **Grid** render these nodes to achieve better performance. But **Repeat** treats these nod…
116 - **cachedCount()** of **Repeat** indicates the nodes that are treated as invisible by **Repeat**. …
118 …number of nodes that may appear on the screen of the current template, **Repeat** can be reused as…
145 Repeat<string>(this.simpleList)
178 …tems 1 and 2 are exchanged, if the key is as the same as the last one, **Repeat** reuses the previ…
199 Repeat<string>(this.simpleList)
228 
366 
462 Repeat<Repeat006Clazz>(this.simpleList)
508 
510 ### Using Repeat in a Nesting Manner
515 // Repeat can be nested in other components.
531 Text('Using Repeat virtualScroll in a Nesting Manner')
535 Repeat<string>(this.outerList)
542 Repeat<number>(this.innerList)
574 
580 Use **virtualScroll** of **Repeat** in the **List** container component. The following is an exampl…
618 Text('List Contains the Repeat Component')
623 Repeat<DemoListItemInfo>(this.videoList)
679 
683 Use **virtualScroll** of **Repeat** in the **Grid** container component. The following is an exampl…
719 Text('Grid Contains the Repeat Component')
725 Repeat<DemoGridItemInfo>(this.itemList)
807 
811 Use **virtualScroll** of **Repeat** in the **Swiper** container component. The following is an exam…
852 Text('Swiper Contains the Repeat Component')
861 Repeat(this.pics)
890 
896 Declare the **Repeat** component in the **List** component to implement the **key** generation logi…
923 Repeat(this.arrayHolder.arr)
957 
979 Repeat(this.arrayHolder.arr)
1020 
1024 … is large, the lazy loading is used to load some data first. To enable **Repeat** to display the c…
1065 Repeat(this.vehicleItems)
1116 
1118 ### Constraints on the Mixed Use of Repeat and @Builder
1120 When **Repeat** and @Builder are used together, parameters of the **RepeatItem** type must be passe…
1140 …Text('Use Repeat and @Builder together: The abnormal display is on the left, and the normal displa…
1146 Repeat<number>(this.simpleList1)
1167 Repeat<number>(this.simpleList2)
1213 