|
@@ -1,7 +1,6 @@
|
|
|
import {
|
|
import {
|
|
|
getCurrentInstance,
|
|
getCurrentInstance,
|
|
|
SetupContext,
|
|
SetupContext,
|
|
|
- ComponentOptions,
|
|
|
|
|
ComponentInternalInstance
|
|
ComponentInternalInstance
|
|
|
} from '../component'
|
|
} from '../component'
|
|
|
import {
|
|
import {
|
|
@@ -100,6 +99,23 @@ export function useTransitionState(): TransitionState {
|
|
|
|
|
|
|
|
const BaseTransitionImpl = {
|
|
const BaseTransitionImpl = {
|
|
|
name: `BaseTransition`,
|
|
name: `BaseTransition`,
|
|
|
|
|
+
|
|
|
|
|
+ props: {
|
|
|
|
|
+ mode: String,
|
|
|
|
|
+ appear: Boolean,
|
|
|
|
|
+ persisted: Boolean,
|
|
|
|
|
+ // enter
|
|
|
|
|
+ onBeforeEnter: Function,
|
|
|
|
|
+ onEnter: Function,
|
|
|
|
|
+ onAfterEnter: Function,
|
|
|
|
|
+ onEnterCancelled: Function,
|
|
|
|
|
+ // leave
|
|
|
|
|
+ onBeforeLeave: Function,
|
|
|
|
|
+ onLeave: Function,
|
|
|
|
|
+ onAfterLeave: Function,
|
|
|
|
|
+ onLeaveCancelled: Function
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
setup(props: BaseTransitionProps, { slots }: SetupContext) {
|
|
setup(props: BaseTransitionProps, { slots }: SetupContext) {
|
|
|
const instance = getCurrentInstance()!
|
|
const instance = getCurrentInstance()!
|
|
|
const state = useTransitionState()
|
|
const state = useTransitionState()
|
|
@@ -201,24 +217,6 @@ const BaseTransitionImpl = {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-if (__DEV__) {
|
|
|
|
|
- ;(BaseTransitionImpl as ComponentOptions).props = {
|
|
|
|
|
- mode: String,
|
|
|
|
|
- appear: Boolean,
|
|
|
|
|
- persisted: Boolean,
|
|
|
|
|
- // enter
|
|
|
|
|
- onBeforeEnter: Function,
|
|
|
|
|
- onEnter: Function,
|
|
|
|
|
- onAfterEnter: Function,
|
|
|
|
|
- onEnterCancelled: Function,
|
|
|
|
|
- // leave
|
|
|
|
|
- onBeforeLeave: Function,
|
|
|
|
|
- onLeave: Function,
|
|
|
|
|
- onAfterLeave: Function,
|
|
|
|
|
- onLeaveCancelled: Function
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// export the public type for h/tsx inference
|
|
// export the public type for h/tsx inference
|
|
|
// also to avoid inline import() in generated d.ts files
|
|
// also to avoid inline import() in generated d.ts files
|
|
|
export const BaseTransition = (BaseTransitionImpl as any) as {
|
|
export const BaseTransition = (BaseTransitionImpl as any) as {
|