import { genDirectiveModifiers, genDirectivesForElement } from './directive'
import { genBlock } from './block'
import { genModelHandler } from './vModel'
+import { isBuiltInComponent } from '../transforms/transformElement'
export function genCreateComponent(
operation: CreateComponentIRNode,
} else if (operation.asset) {
return toValidAssetId(operation.tag, 'component')
} else {
+ const { tag } = operation
+ const builtInTag = isBuiltInComponent(tag)
+ if (builtInTag) {
+ // @ts-expect-error
+ helper(builtInTag)
+ return `_${builtInTag}`
+ }
return genExpression(
extend(createSimpleExpression(operation.tag, false), { ast: null }),
context,
asset = false
}
+ const builtInTag = isBuiltInComponent(tag)
+ if (builtInTag) {
+ tag = builtInTag
+ asset = false
+ }
+
const dotIndex = tag.indexOf('.')
if (dotIndex > 0) {
const ns = resolveSetupReference(tag.slice(0, dotIndex), context)
function isComponentTag(tag: string) {
return tag === 'component' || tag === 'Component'
}
+
+export function isBuiltInComponent(tag: string): string | undefined {
+ if (tag === 'Transition' || tag === 'transition') {
+ return 'Transition'
+ }
+}