refactor(ssr): adjust ssr fragment anchor content
This commit is contained in:
@@ -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(`<!--]-->`)
|
||||
}
|
||||
|
||||
@@ -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 []
|
||||
|
||||
@@ -256,9 +256,9 @@ function renderVNode(
|
||||
push(children ? `<!--${children}-->` : `<!---->`)
|
||||
break
|
||||
case Fragment:
|
||||
push(`<!--1-->`) // open
|
||||
push(`<!--[-->`) // open
|
||||
renderVNodeChildren(push, children as VNodeArrayChildren, parentComponent)
|
||||
push(`<!--0-->`) // close
|
||||
push(`<!--]-->`) // close
|
||||
break
|
||||
default:
|
||||
if (shapeFlag & ShapeFlags.ELEMENT) {
|
||||
|
||||
Reference in New Issue
Block a user