]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: remove InsertPosition
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Wed, 29 Nov 2023 13:20:05 +0000 (21:20 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Wed, 29 Nov 2023 13:20:05 +0000 (21:20 +0800)
packages/runtime-vapor/src/render.ts

index a120412fe92e1dd1a7a38b45e3395810210a08c4..a5a8c4e07e3e3ab384bd6d55facfde55d584efd3 100644 (file)
@@ -30,22 +30,11 @@ export function normalizeContainer(container: string | ParentNode): ParentNode {
     : container
 }
 
-export const enum InsertPosition {
-  FIRST,
-  LAST
-}
-
 export function insert(
   block: Block,
   parent: ParentNode,
-  anchor: Node | InsertPosition | null = null
+  anchor: Node | null = null
 ) {
-  anchor =
-    typeof anchor === 'number'
-      ? anchor === InsertPosition.FIRST
-        ? parent.firstChild
-        : null
-      : anchor
   // if (!isHydrating) {
   if (block instanceof Node) {
     parent.insertBefore(block, anchor)