Skip to content

Commit a44a715

Browse files
authored
feat: add multiRoot marker for template-only vapor component (#385)
1 parent 69c2ed1 commit a44a715

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/transform.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ async function doCompileTemplate(
383383
expressionPlugins,
384384
},
385385
})
386-
let { code, errors, map } = res
386+
// @ts-expect-error multiRoot in 3.6
387+
let { code, errors, map, multiRoot } = res
387388
if (errors.length) {
388389
return { code, map, errors }
389390
}
@@ -396,6 +397,10 @@ async function doCompileTemplate(
396397
`$1 ${fnName}`,
397398
)}` + `\n${COMP_IDENTIFIER}.${fnName} = ${fnName}`
398399

400+
if(descriptor.vapor && !ssr) {
401+
code += `\n${COMP_IDENTIFIER}.__multiRoot = ${multiRoot}`
402+
}
403+
399404
if (isTS) {
400405
code = await transformTS(code, isJSX)
401406
}

0 commit comments

Comments
 (0)