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

@@ -19,7 +19,7 @@ export function ssrRenderSlot(
parentComponent: ComponentInternalInstance
) {
// template-compiled slots are always rendered as fragments
push(`<!--1-->`)
push(`<!--[-->`)
const slotFn = slots[slotName]
if (slotFn) {
if (slotFn.length > 1) {
@@ -33,5 +33,5 @@ export function ssrRenderSlot(
} else if (fallbackRenderFn) {
fallbackRenderFn()
}
push(`<!--0-->`)
push(`<!--]-->`)
}

View File

@@ -9,9 +9,9 @@ export async function ssrRenderSuspense({
try {
if (renderContent) {
const { push, getBuffer } = createBuffer()
push(`<!--1-->`)
push(`<!--[-->`)
renderContent(push)
push(`<!--0-->`)
push(`<!--]-->`)
return await getBuffer()
} else {
return []
@@ -19,9 +19,9 @@ export async function ssrRenderSuspense({
} catch {
if (renderFallback) {
const { push, getBuffer } = createBuffer()
push(`<!--1-->`)
push(`<!--[-->`)
renderFallback(push)
push(`<!--0-->`)
push(`<!--]-->`)
return getBuffer()
} else {
return []