From e8d3a7d7a17f9e66d592fb1ddc4a603af9958d36 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 16 Jul 2022 22:03:44 +0800 Subject: [PATCH] fix(codegen): script setup should not attempt to resolve native elements as component fix #12674 --- src/compiler/codegen/index.ts | 5 +++-- test/unit/modules/compiler/codegen.spec.ts | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/compiler/codegen/index.ts b/src/compiler/codegen/index.ts index 823154e28..5992859eb 100644 --- a/src/compiler/codegen/index.ts +++ b/src/compiler/codegen/index.ts @@ -95,14 +95,15 @@ export function genElement(el: ASTElement, state: CodegenState): string { code = genComponent(el.component, el, state) } else { let data - if (!el.plain || (el.pre && state.maybeComponent(el))) { + const maybeComponent = state.maybeComponent(el) + if (!el.plain || (el.pre && maybeComponent)) { data = genData(el, state) } let tag: string | undefined // check if this is a component in