Skip to content

Commit

Permalink
fix: use parser from runtime-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 27, 2023
1 parent 0867ca0 commit 339a658
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-vapor/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
}
2 changes: 1 addition & 1 deletion packages/compiler-vapor/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}>`
}
}
Expand Down

0 comments on commit 339a658

Please sign in to comment.