Function
insertNodeAt
(
parentElement: Element,
element: Element,
index: number,
)
Source from the content-addressed store, hash-verified
| 89 | * @see https://github.com/Alfred-Skyblue/vue-draggable-plus/blob/a3829222095e1949bf2c9a20979d7b5930e66f14/src/utils/index.ts#L81C1-L94C2 |
| 90 | */ |
| 91 | export function insertNodeAt( |
| 92 | parentElement: Element, |
| 93 | element: Element, |
| 94 | index: number, |
| 95 | ) { |
| 96 | const refElement = parentElement.children[index] |
| 97 | parentElement.insertBefore(element, refElement) |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Removes a node from the DOM. |
Tested by
no test coverage detected