refactor(ssr): adjust ssr fragment anchor content

This commit is contained in:
Evan You
2020-03-13 11:55:04 -04:00
parent cad5bcce40
commit a05d41c940
12 changed files with 57 additions and 56 deletions

View File

@@ -111,7 +111,7 @@ export function processChildren(
asFragment = false
) {
if (asFragment) {
context.pushStringPart(`<!--1-->`)
context.pushStringPart(`<!--[-->`)
}
for (let i = 0; i < children.length; i++) {
const child = children[i]
@@ -136,7 +136,7 @@ export function processChildren(
}
}
if (asFragment) {
context.pushStringPart(`<!--0-->`)
context.pushStringPart(`<!--]-->`)
}
}

View File

@@ -33,12 +33,12 @@ export function ssrProcessFor(node: ForNode, context: SSRTransformContext) {
needFragmentWrapper
)
// v-for always renders a fragment
context.pushStringPart(`<!--1-->`)
context.pushStringPart(`<!--[-->`)
context.pushStatement(
createCallExpression(context.helper(SSR_RENDER_LIST), [
node.source,
renderLoop
])
)
context.pushStringPart(`<!--0-->`)
context.pushStringPart(`<!--]-->`)
}