refactor(runtime-dom): insertBefore anchor null equals appendChild (#1463)

This commit is contained in:
蜗牛老湿 2020-06-30 01:19:31 +08:00 committed by GitHub
parent 82b28a5ecb
commit f8c6f8c7b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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