]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: use parser from runtime-dom
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Mon, 27 Nov 2023 06:13:09 +0000 (14:13 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Mon, 27 Nov 2023 06:13:09 +0000 (14:13 +0800)
packages/compiler-vapor/src/compile.ts
packages/compiler-vapor/src/transform.ts

index 3ad874e8a01cdc8354456bca1a85091a3cb2a46d..c8a23dd631b682b19a21631922426c37c993c44c 100644 (file)
@@ -2,7 +2,7 @@ import {
   type CodegenResult,
   type CompilerOptions,
   type RootNode,
-  baseParse,
+  parse,
 } from '@vue/compiler-dom'
 import { isString } from '@vue/shared'
 import { transform } from './transform'
@@ -13,7 +13,7 @@ export function compile(
   template: string | RootNode,
   options: CompilerOptions = {},
 ): CodegenResult {
-  const ast = isString(template) ? baseParse(template, options) : template
+  const ast = isString(template) ? parse(template, options) : template
   const ir = transform(ast, options)
   return generate(ir, options)
 }
index a948284fa91317014032deb038b82fca91b86447..416401b833d3c7c9346d33b72597df24beebd65e 100644 (file)
@@ -282,7 +282,7 @@ function transformElement(ctx: TransformContext<ElementNode>) {
   if (children.length) transformChildren(ctx)
 
   // TODO remove unnecessary close tag, e.g. if it's the last element of the template
-  if (!node.isSelfClosing || !isVoidTag(tag)) {
+  if (!isVoidTag(tag)) {
     ctx.template += `</${tag}>`
   }
 }