wip(ssr): element scopeId

This commit is contained in:
Evan You
2020-02-06 16:51:26 -05:00
parent 4cc39e14a2
commit 797cc18967
5 changed files with 49 additions and 21 deletions

View File

@@ -31,6 +31,7 @@ export function compile(
// apply DOM-specific parsing options
...parserOptions,
ssr: true,
scopeId: options.mode === 'function' ? null : options.scopeId,
// always prefix since compiler-ssr doesn't have size concern
prefixIdentifiers: true,
// disalbe optimizations that are unnecessary for ssr

View File

@@ -246,6 +246,10 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
removeStaticBinding(openTag, 'class')
}
if (context.scopeId) {
openTag.push(` ${context.scopeId}`)
}
openTag.push(`>`)
if (rawChildren) {
openTag.push(rawChildren)