MCPcopy Create free account
hub / github.com/cn-docs/vueuse / insertNodeAt

Function insertNodeAt

packages/integrations/useSortable/index.ts:91–98  ·  view source on GitHub ↗
(
  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 */
91export 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.

Callers 1

moveArrayElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected