Home > @zero-dim/designer > swapChildrenPositions
swapChildrenPositions() function
将fromId下面 children 为oldIndex索引的数据移动到toId下面 children 为newIndex的位置
Signature:
typescript
export declare function swapChildrenPositions(nodes: Schema[], fromId: string, toId: string, oldIndex: number, newIndex: number): Schema[];
Parameters
Parameter | Type | Description |
---|---|---|
nodes | Schema[] | |
fromId | string | |
toId | string | |
oldIndex | number | |
newIndex | number |
Schema[]