feat(transition): properly handle transition & transition-group in compiler
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { baseCompile, CompilerOptions, CodegenResult } from '@vue/compiler-core'
|
||||
import {
|
||||
baseCompile,
|
||||
CompilerOptions,
|
||||
CodegenResult,
|
||||
isBuiltInType
|
||||
} from '@vue/compiler-core'
|
||||
import { parserOptionsMinimal } from './parserOptionsMinimal'
|
||||
import { parserOptionsStandard } from './parserOptionsStandard'
|
||||
import { transformStyle } from './transforms/transformStyle'
|
||||
@@ -8,6 +13,7 @@ import { transformVText } from './transforms/vText'
|
||||
import { transformModel } from './transforms/vModel'
|
||||
import { transformOn } from './transforms/vOn'
|
||||
import { transformShow } from './transforms/vShow'
|
||||
import { TRANSITION, TRANSITION_GROUP } from './runtimeHelpers'
|
||||
|
||||
export function compile(
|
||||
template: string,
|
||||
@@ -25,6 +31,13 @@ export function compile(
|
||||
on: transformOn,
|
||||
show: transformShow,
|
||||
...(options.directiveTransforms || {})
|
||||
},
|
||||
isBuiltInComponent: tag => {
|
||||
if (isBuiltInType(tag, `Transition`)) {
|
||||
return TRANSITION
|
||||
} else if (isBuiltInType(tag, `TransitionGroup`)) {
|
||||
return TRANSITION_GROUP
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user