Skip to content

Commit

Permalink
fix(transition): transition should accept multiple handlers on same e…
Browse files Browse the repository at this point in the history
…vent

fix #1746
  • Loading branch information
yyx990803 committed Aug 6, 2020
1 parent 791eff3 commit 48576e5
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/runtime-core/src/components/BaseTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export function useTransitionState(): TransitionState {
return state
}

const TransitionHookValidator = [Function, Array]

const BaseTransitionImpl = {
name: `BaseTransition`,

Expand All @@ -113,20 +115,20 @@ const BaseTransitionImpl = {
appear: Boolean,
persisted: Boolean,
// enter
onBeforeEnter: Function,
onEnter: Function,
onAfterEnter: Function,
onEnterCancelled: Function,
onBeforeEnter: TransitionHookValidator,
onEnter: TransitionHookValidator,
onAfterEnter: TransitionHookValidator,
onEnterCancelled: TransitionHookValidator,
// leave
onBeforeLeave: Function,
onLeave: Function,
onAfterLeave: Function,
onLeaveCancelled: Function,
onBeforeLeave: TransitionHookValidator,
onLeave: TransitionHookValidator,
onAfterLeave: TransitionHookValidator,
onLeaveCancelled: TransitionHookValidator,
// appear
onBeforeAppear: Function,
onAppear: Function,
onAfterAppear: Function,
onAppearCancelled: Function
onBeforeAppear: TransitionHookValidator,
onAppear: TransitionHookValidator,
onAfterAppear: TransitionHookValidator,
onAppearCancelled: TransitionHookValidator
},

setup(props: BaseTransitionProps, { slots }: SetupContext) {
Expand Down

0 comments on commit 48576e5

Please sign in to comment.