From: 三咲智子 Kevin Deng Date: Mon, 27 Nov 2023 06:13:09 +0000 (+0800) Subject: fix: use parser from runtime-dom X-Git-Tag: v3.6.0-alpha.1~16^2~802 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=339a658cef158ab7d525fd67eb915162fd71a107;p=thirdparty%2Fvuejs%2Fcore.git fix: use parser from runtime-dom --- diff --git a/packages/compiler-vapor/src/compile.ts b/packages/compiler-vapor/src/compile.ts index 3ad874e8a0..c8a23dd631 100644 --- a/packages/compiler-vapor/src/compile.ts +++ b/packages/compiler-vapor/src/compile.ts @@ -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) } diff --git a/packages/compiler-vapor/src/transform.ts b/packages/compiler-vapor/src/transform.ts index a948284fa9..416401b833 100644 --- a/packages/compiler-vapor/src/transform.ts +++ b/packages/compiler-vapor/src/transform.ts @@ -282,7 +282,7 @@ function transformElement(ctx: TransformContext) { 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 += `` } }