refactor(fragments): remove visible anchors for fragments
This commit is contained in:
@@ -262,7 +262,7 @@ describe('ssr: renderToString', () => {
|
||||
)
|
||||
).toBe(
|
||||
`<div>parent<div class="child">` +
|
||||
`<!----><span>from slot</span><!---->` +
|
||||
`<span>from slot</span>` +
|
||||
`</div></div>`
|
||||
)
|
||||
|
||||
@@ -277,7 +277,7 @@ describe('ssr: renderToString', () => {
|
||||
}
|
||||
})
|
||||
)
|
||||
).toBe(`<div>parent<div class="child"><!---->fallback<!----></div></div>`)
|
||||
).toBe(`<div>parent<div class="child">fallback</div></div>`)
|
||||
})
|
||||
|
||||
test('nested components with vnode slots', async () => {
|
||||
@@ -321,7 +321,7 @@ describe('ssr: renderToString', () => {
|
||||
)
|
||||
).toBe(
|
||||
`<div>parent<div class="child">` +
|
||||
`<!----><span>from slot</span><!---->` +
|
||||
`<span>from slot</span>` +
|
||||
`</div></div>`
|
||||
)
|
||||
})
|
||||
@@ -339,7 +339,7 @@ describe('ssr: renderToString', () => {
|
||||
|
||||
expect(await renderToString(app)).toBe(
|
||||
`<div>parent<div class="child">` +
|
||||
`<!----><span>from slot</span><!---->` +
|
||||
`<span>from slot</span>` +
|
||||
`</div></div>`
|
||||
)
|
||||
})
|
||||
@@ -461,9 +461,7 @@ describe('ssr: renderToString', () => {
|
||||
createCommentVNode('qux')
|
||||
])
|
||||
)
|
||||
).toBe(
|
||||
`<div>foo<span>bar</span><!----><span>baz</span><!----><!--qux--></div>`
|
||||
)
|
||||
).toBe(`<div>foo<span>bar</span><span>baz</span><!--qux--></div>`)
|
||||
})
|
||||
|
||||
test('void elements', async () => {
|
||||
|
||||
@@ -19,8 +19,6 @@ export function ssrRenderSlot(
|
||||
parentComponent: ComponentInternalInstance
|
||||
) {
|
||||
const slotFn = slots[slotName]
|
||||
// template-compiled slots are always rendered as fragments
|
||||
push(`<!---->`)
|
||||
if (slotFn) {
|
||||
if (slotFn.length > 1) {
|
||||
// only ssr-optimized slot fns accept more than 1 arguments
|
||||
@@ -33,5 +31,4 @@ export function ssrRenderSlot(
|
||||
} else if (fallbackRenderFn) {
|
||||
fallbackRenderFn()
|
||||
}
|
||||
push(`<!---->`)
|
||||
}
|
||||
|
||||
@@ -238,9 +238,7 @@ function renderVNode(
|
||||
push(children ? `<!--${children}-->` : `<!---->`)
|
||||
break
|
||||
case Fragment:
|
||||
push(`<!---->`)
|
||||
renderVNodeChildren(push, children as VNodeArrayChildren, parentComponent)
|
||||
push(`<!---->`)
|
||||
break
|
||||
default:
|
||||
if (shapeFlag & ShapeFlags.ELEMENT) {
|
||||
|
||||
Reference in New Issue
Block a user