feat(runtime): support rendering comment nodes

This commit is contained in:
Evan You
2019-09-24 14:37:14 -04:00
parent f5b3f580f1
commit 76a1196935
4 changed files with 19 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ import {
FunctionalComponent,
Data
} from './component'
import { VNode, normalizeVNode, createVNode, Empty } from './vnode'
import { VNode, normalizeVNode, createVNode, Comment } from './vnode'
import { ShapeFlags } from './shapeFlags'
import { handleError, ErrorCodes } from './errorHandling'
import { PatchFlags } from './patchFlags'
@@ -45,7 +45,7 @@ export function renderComponentRoot(
}
} catch (err) {
handleError(err, instance, ErrorCodes.RENDER_FUNCTION)
result = createVNode(Empty)
result = createVNode(Comment)
}
currentRenderingInstance = null
return result