From e8dd725e41e636f60426d072557034bbad2a6d84 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 28 Oct 2018 14:22:52 -0400 Subject: [PATCH] fix: fragment replaceVNode --- packages/runtime-core/__tests__/fragment.spec.ts | 4 ++-- packages/runtime-core/src/createRenderer.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/__tests__/fragment.spec.ts b/packages/runtime-core/__tests__/fragment.spec.ts index 17488df5..e558a741 100644 --- a/packages/runtime-core/__tests__/fragment.spec.ts +++ b/packages/runtime-core/__tests__/fragment.spec.ts @@ -80,7 +80,7 @@ describe('Fragments', () => { render() { return state.ok ? [h('div', 'one'), 'two'] - : [h('div', 'foo'), 'bar', 'baz'] + : [h('pre', 'foo'), 'bar', 'baz'] } } const root = nodeOps.createElement('div') @@ -90,7 +90,7 @@ describe('Fragments', () => { state.ok = false await nextTick() - expect(serialize(root)).toBe(`
foo
barbaz
`) + expect(serialize(root)).toBe(`
foo
barbaz
`) }) it('should be able to patch fragment children (explcitly keyed)', async () => { diff --git a/packages/runtime-core/src/createRenderer.ts b/packages/runtime-core/src/createRenderer.ts index 9e90371b..354450d9 100644 --- a/packages/runtime-core/src/createRenderer.ts +++ b/packages/runtime-core/src/createRenderer.ts @@ -164,14 +164,14 @@ export function createRenderer(options: RendererOptions) { if (childFlags !== ChildrenFlags.NO_CHILDREN) { const hasSVGChildren = isSVG && tag !== 'foreignObject' if (childFlags & ChildrenFlags.SINGLE_VNODE) { - mount(children as VNode, el, contextVNode, hasSVGChildren, endNode) + mount(children as VNode, el, contextVNode, hasSVGChildren, null) } else if (childFlags & ChildrenFlags.MULTIPLE_VNODES) { mountArrayChildren( children as VNode[], el, contextVNode, hasSVGChildren, - endNode + null ) } }