Skip to content

Commit

Permalink
fix: ensure space before scope id
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 20, 2023
1 parent 02a146a commit ec4045f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions packages/compiler-ssr/__tests__/ssrScopeId.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ describe('ssr: scopeId', () => {
).toMatchInlineSnapshot(`
"import { mergeProps as _mergeProps } from \\"vue\\"
import { ssrRenderAttrs as _ssrRenderAttrs } from \\"vue/server-renderer\\"
export function ssrRender(_ctx, _push, _parent, _attrs) {
_push(\`<div\${_ssrRenderAttrs(_mergeProps({ class: \\"red\\" }, _attrs))}data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></div>\`)
}"`)
_push(\`<div\${_ssrRenderAttrs(_mergeProps({ class: \\"red\\" }, _attrs))} data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></div>\`)
}"
`)

// with dynamic tag
expect(
Expand All @@ -161,7 +162,7 @@ describe('ssr: scopeId', () => {
_ctx.someTag
}\${
_ssrRenderAttrs(_mergeProps({ class: \\"red\\" }, _attrs))
}data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></\${
} data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></\${
_ctx.someTag
}>\`)
}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function ssrProcessTransitionGroup(
context.pushStringPart(propsExp)
}
if (scopeId) {
context.pushStringPart(scopeId)
context.pushStringPart(` ${scopeId}`)
}
context.pushStringPart(`>`)

Expand All @@ -95,7 +95,7 @@ export function ssrProcessTransitionGroup(
context.pushStringPart(propsExp)
}
if (scopeId) {
context.pushStringPart(scopeId)
context.pushStringPart(` ${scopeId}`)
}
context.pushStringPart(`>`)
processChildren(node, context, false, true)
Expand Down

0 comments on commit ec4045f

Please sign in to comment.