File tree Expand file tree Collapse file tree 6 files changed +12
-9
lines changed
src/platforms/web/runtime/components Expand file tree Collapse file tree 6 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ declare interface Component {
1414 // assets
1515 static directive : ( id : string , def ?: Function | Object ) => Function | Object | void ;
1616 static component : ( id : string , def ?: Class < Component > | Object ) => Class < Component > ;
17- static transition : ( id : string , def ? : Object ) => Object | void ;
1817 static filter : ( id : string , def ?: Function ) => Function | void ;
1918
2019 // public properties
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ declare interface GlobalAPI {
1414
1515 directive: ( id : string , def ? : Function | Object ) => Function | Object | void ;
1616 component: ( id : string , def ?: Class < Component > | Object ) => Class < Component > ;
17- transition: ( id : string , def ? : Object ) => Object | void ;
1817 filter: ( id : string , def ? : Function ) => Function | void ;
1918
2019 // allow dynamic method registration
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ declare type ComponentOptions = {
5656 _isComponent ?: true ,
5757 _propKeys ?: Array < string > ,
5858 _parentVnode ?: VNode ,
59- _parentListeners ?: ?{ [ key : string ] : Function | Array < Function > } ,
59+ _parentListeners ?: ?Object ,
6060 _renderChildren ?: ?VNodeChildren
6161}
6262
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ declare interface VNodeData {
4444 staticAttrs ?: { [ key : string ] : string } ;
4545 hook ?: { [ key : string ] : Function } ;
4646 on ?: { [ key : string ] : Function | Array < Function > } ;
47- transition ?: string | Object ;
47+ transition ?: Object ;
4848 inlineTemplate ?: {
4949 render : Function ,
5050 staticRenderFns : Array < Function >
Original file line number Diff line number Diff line change 1+ /* @flow */
2+
13// Provides transition support for list items.
24// supports move transitions using the FLIP technique.
35
@@ -29,7 +31,7 @@ delete props.mode
2931export default {
3032 props,
3133
32- render ( h ) {
34+ render ( h : Function ) {
3335 const tag = this . tag || this . $vnode . data . tag || 'span'
3436 const map = Object . create ( null )
3537 const prevChildren = this . prevChildren = this . children
@@ -127,7 +129,7 @@ export default {
127129 } ,
128130
129131 methods : {
130- hasMove ( el , moveClass ) {
132+ hasMove ( el : Element , moveClass : string ) : boolean {
131133 /* istanbul ignore if */
132134 if ( ! hasTransition ) {
133135 return false
Original file line number Diff line number Diff line change 1+ /* @flow */
2+
13// Provides transition support for a single element/component.
24// supports transition mode (out-in / in-out)
35
@@ -18,7 +20,7 @@ export const transitionProps = {
1820 appearActiveClass : String
1921}
2022
21- export function extractTransitionData ( comp ) {
23+ export function extractTransitionData ( comp : Component ) : Object {
2224 const data = { }
2325 const options = comp . $options
2426 // props
@@ -38,7 +40,7 @@ export default {
3840 name : 'transition' ,
3941 props : transitionProps ,
4042 _abstract : true ,
41- render ( h ) {
43+ render ( h : Function ) {
4244 let children = this . $slots . default
4345 if ( ! children ) {
4446 return
@@ -91,10 +93,11 @@ export default {
9193 // apply transition data to child
9294 // use getRealChild() to ignore abstract components e.g. keep-alive
9395 const child = getRealChild ( rawChild )
96+ if ( ! child ) return
9497 child . key = child . key || `__v${ child . tag + this . _uid } __`
9598 const data = ( child . data || ( child . data = { } ) ) . transition = extractTransitionData ( this )
9699 const oldRawChild = this . _vnode
97- const oldChild = getRealChild ( oldRawChild )
100+ const oldChild : any = getRealChild ( oldRawChild )
98101
99102 // handle transition mode
100103 if ( mode && oldChild && oldChild . data && oldChild . key !== child . key ) {
You can’t perform that action at this time.
0 commit comments