Просмотр исходного кода

refactor: remove InsertPosition

三咲智子 Kevin Deng 2 лет назад
Родитель
Сommit
b3fdccec6f
1 измененных файлов с 1 добавлено и 12 удалено
  1. 1 12
      packages/runtime-vapor/src/render.ts

+ 1 - 12
packages/runtime-vapor/src/render.ts

@@ -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)