Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 4533af4

Browse files
committed
feat(compiler-translate)remove unnecessary close tag in componet tagType
1 parent 7db7487 commit 4533af4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/compiler-vapor/src/transforms/transformElement.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ export const transformElement: NodeTransform = (node, context) => {
6161

6262
// TODO remove unnecessary close tag, e.g. if it's the last element of the template
6363
if (!isVoidTag(tag)) {
64-
context.template += `</${tag}>`
64+
if (node.tagType === ElementTypes.COMPONENT) {
65+
context.template = `<${tag}/>`
66+
} else {
67+
context.template += `</${tag}>`
68+
}
6569
}
6670
}
6771
}

0 commit comments

Comments
 (0)