feat(transition): properly handle transition & transition-group in compiler

This commit is contained in:
Evan You
2019-11-29 12:42:04 -05:00
parent 4e8d57bdfb
commit 0e3e07079a
7 changed files with 77 additions and 40 deletions

View File

@@ -17,7 +17,7 @@ import {
CacheExpression,
createCacheExpression
} from './ast'
import { isString, isArray } from '@vue/shared'
import { isString, isArray, NOOP } from '@vue/shared'
import { CompilerError, defaultOnError } from './errors'
import {
TO_STRING,
@@ -68,6 +68,7 @@ export type StructuralDirectiveTransform = (
export interface TransformOptions {
nodeTransforms?: NodeTransform[]
directiveTransforms?: { [name: string]: DirectiveTransform }
isBuiltInComponent?: (tag: string) => symbol | void
prefixIdentifiers?: boolean
hoistStatic?: boolean
cacheHandlers?: boolean
@@ -110,6 +111,7 @@ function createTransformContext(
cacheHandlers = false,
nodeTransforms = [],
directiveTransforms = {},
isBuiltInComponent = NOOP,
onError = defaultOnError
}: TransformOptions
): TransformContext {
@@ -132,6 +134,7 @@ function createTransformContext(
cacheHandlers,
nodeTransforms,
directiveTransforms,
isBuiltInComponent,
onError,
parent: null,
currentNode: root,