fix(compiler-core): handle base-transition
This commit is contained in:
@@ -31,7 +31,7 @@ import { extend } from '@vue/shared'
|
||||
|
||||
// Portal and Fragment are native types, not components
|
||||
const isBuiltInComponent = /*#__PURE__*/ makeMap(
|
||||
`suspense,keep-alive,keepalive,transition`,
|
||||
`suspense,keep-alive,keepalive,base-transition`,
|
||||
true
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ export const FRAGMENT = Symbol(__DEV__ ? `Fragment` : ``)
|
||||
export const PORTAL = Symbol(__DEV__ ? `Portal` : ``)
|
||||
export const SUSPENSE = Symbol(__DEV__ ? `Suspense` : ``)
|
||||
export const KEEP_ALIVE = Symbol(__DEV__ ? `KeepAlive` : ``)
|
||||
export const TRANSITION = Symbol(__DEV__ ? `Transition` : ``)
|
||||
export const BASE_TRANSITION = Symbol(__DEV__ ? `BaseTransition` : ``)
|
||||
export const OPEN_BLOCK = Symbol(__DEV__ ? `openBlock` : ``)
|
||||
export const CREATE_BLOCK = Symbol(__DEV__ ? `createBlock` : ``)
|
||||
@@ -32,7 +31,6 @@ export const helperNameMap: any = {
|
||||
[PORTAL]: `Portal`,
|
||||
[SUSPENSE]: `Suspense`,
|
||||
[KEEP_ALIVE]: `KeepAlive`,
|
||||
[TRANSITION]: `Transition`,
|
||||
[BASE_TRANSITION]: `BaseTransition`,
|
||||
[OPEN_BLOCK]: `openBlock`,
|
||||
[CREATE_BLOCK]: `createBlock`,
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
PORTAL,
|
||||
SUSPENSE,
|
||||
KEEP_ALIVE,
|
||||
TRANSITION
|
||||
BASE_TRANSITION
|
||||
} from '../runtimeHelpers'
|
||||
import { getInnerRange, isVSlot, toValidAssetId, findProp } from '../utils'
|
||||
import { buildSlots } from './vSlot'
|
||||
@@ -60,7 +60,7 @@ export const transformElement: NodeTransform = (node, context) => {
|
||||
const isPortal = isBuiltInType(tag, 'Portal')
|
||||
const isSuspense = isBuiltInType(tag, 'Suspense')
|
||||
const isKeepAlive = isBuiltInType(tag, 'KeepAlive')
|
||||
const isTransition = isBuiltInType(tag, 'Transition')
|
||||
const isBaseTransition = isBuiltInType(tag, 'BaseTransition')
|
||||
const isComponent = tagType === ElementTypes.COMPONENT
|
||||
|
||||
let hasProps = props.length > 0
|
||||
@@ -102,8 +102,8 @@ export const transformElement: NodeTransform = (node, context) => {
|
||||
nodeType = context.helper(SUSPENSE)
|
||||
} else if (isKeepAlive) {
|
||||
nodeType = context.helper(KEEP_ALIVE)
|
||||
} else if (isTransition) {
|
||||
nodeType = context.helper(TRANSITION)
|
||||
} else if (isBaseTransition) {
|
||||
nodeType = context.helper(BASE_TRANSITION)
|
||||
} else if (isComponent) {
|
||||
// user component w/ resolve
|
||||
context.helper(RESOLVE_COMPONENT)
|
||||
|
||||
Reference in New Issue
Block a user