]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-dom): insertBefore anchor null equals appendChild (#1463)
author蜗牛老湿 <shengxinjing@users.noreply.github.com>
Mon, 29 Jun 2020 17:19:31 +0000 (01:19 +0800)
committerGitHub <noreply@github.com>
Mon, 29 Jun 2020 17:19:31 +0000 (13:19 -0400)
packages/runtime-dom/src/nodeOps.ts

index 6d766385ca34dacf852073fb0d3a2f91b208e84c..72aa25a3930c74e70de61c0c8a7be28d5d756b94 100644 (file)
@@ -9,11 +9,7 @@ let tempSVGContainer: SVGElement
 
 export const nodeOps: Omit<RendererOptions<Node, Element>, 'patchProp'> = {
   insert: (child, parent, anchor) => {
-    if (anchor) {
-      parent.insertBefore(child, anchor)
-    } else {
-      parent.appendChild(child)
-    }
+    parent.insertBefore(child, anchor || null)
   },
 
   remove: child => {