1e41f4b71Sopenharmony_ci# restoreId
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe **restoreId** attribute identifies a component in distributed migration scenarios. It can be used to restore the component to a specific state on a remote device.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci>  **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci>  The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## restoreId
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_cirestoreId(value: number)
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciID of the component used for device matching during distributed migration.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**Parameters**
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci| Name| Type  | Mandatory| Description                                                        |
20e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------------------------------------------------------ |
21e41f4b71Sopenharmony_ci| value  | number | Yes  | ID of the component used for device matching during distributed migration. This ID must be unique within an application.|
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci## Components with Distributed Migration Support
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci| Name     | Initial API Version| Description                                    |
26e41f4b71Sopenharmony_ci| --------- | ---- | ---------------------------------------- |
27e41f4b71Sopenharmony_ci| List      | 8    | The index of the list item displayed at the top of the list on the current device will be migrated to the remote device. After the migration, the list item that matches the index is displayed at the top of the list on the remote device.|
28e41f4b71Sopenharmony_ci| Grid      | 9    | The index of the grid item displayed at the top of the grid on the current device will be migrated to the remote device. After the migration, the grid item that matches the index is displayed at the top of the grid on the remote device. The position of the scrollbar cannot be migrated.|
29e41f4b71Sopenharmony_ci| Scroll    | 9    | The absolute distance with the top edge for scrolling will be migrated. The migration effect may be affected by the layout inconsistency resulting from differences in the display specifications between devices.|
30e41f4b71Sopenharmony_ci| WaterFlow | 11   | The index of the **\<FlowItem>** component (child) displayed at the top of the **\<WaterFlow>** component (parent) on the current device, along with the offset (in vp) of the child relative to the main axis of the parent, will be migrated to the remote device. After the migration, the **\<FlowItem>** component that matches the migrated index is displayed on the top of the **\<WaterFlow>** component on the remote device.|
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci## Example
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci```ts
35e41f4b71Sopenharmony_ci// xxx.ets
36e41f4b71Sopenharmony_ci@Entry
37e41f4b71Sopenharmony_ci@Component
38e41f4b71Sopenharmony_cistruct RestoreIdExample {
39e41f4b71Sopenharmony_ci  private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
40e41f4b71Sopenharmony_ci  build() {
41e41f4b71Sopenharmony_ci    Column() {
42e41f4b71Sopenharmony_ci      List({ space: 20 }) {
43e41f4b71Sopenharmony_ci        ForEach(this.arr, (item:number) => {
44e41f4b71Sopenharmony_ci          ListItem() {
45e41f4b71Sopenharmony_ci            Text('' + item)
46e41f4b71Sopenharmony_ci              .width('100%')
47e41f4b71Sopenharmony_ci              .height(100)
48e41f4b71Sopenharmony_ci              .fontSize(16)
49e41f4b71Sopenharmony_ci              .textAlign(TextAlign.Center)
50e41f4b71Sopenharmony_ci              .borderRadius(10)
51e41f4b71Sopenharmony_ci              .backgroundColor(Color.Pink)
52e41f4b71Sopenharmony_ci          }
53e41f4b71Sopenharmony_ci        }, (item:number) => (item.toString()))
54e41f4b71Sopenharmony_ci      }
55e41f4b71Sopenharmony_ci      .restoreId(1)
56e41f4b71Sopenharmony_ci    }
57e41f4b71Sopenharmony_ci  }
58e41f4b71Sopenharmony_ci}
59e41f4b71Sopenharmony_ci```
60