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 {
14
14
// assets
15
15
static directive : ( id : string , def ?: Function | Object ) => Function | Object | void ;
16
16
static component : ( id : string , def ?: Class < Component > | Object ) => Class < Component > ;
17
- static transition : ( id : string , def ? : Object ) => Object | void ;
18
17
static filter : ( id : string , def ?: Function ) => Function | void ;
19
18
20
19
// public properties
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ declare interface GlobalAPI {
14
14
15
15
directive: ( id : string , def ? : Function | Object ) => Function | Object | void ;
16
16
component: ( id : string , def ?: Class < Component > | Object ) => Class < Component > ;
17
- transition: ( id : string , def ? : Object ) => Object | void ;
18
17
filter: ( id : string , def ? : Function ) => Function | void ;
19
18
20
19
// allow dynamic method registration
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ declare type ComponentOptions = {
56
56
_isComponent ?: true ,
57
57
_propKeys ?: Array < string > ,
58
58
_parentVnode ?: VNode ,
59
- _parentListeners ?: ?{ [ key : string ] : Function | Array < Function > } ,
59
+ _parentListeners ?: ?Object ,
60
60
_renderChildren ?: ?VNodeChildren
61
61
}
62
62
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ declare interface VNodeData {
44
44
staticAttrs ?: { [ key : string ] : string } ;
45
45
hook ?: { [ key : string ] : Function } ;
46
46
on ?: { [ key : string ] : Function | Array < Function > } ;
47
- transition ?: string | Object ;
47
+ transition ?: Object ;
48
48
inlineTemplate ?: {
49
49
render : Function ,
50
50
staticRenderFns : Array < Function >
Original file line number Diff line number Diff line change
1
+ /* @flow */
2
+
1
3
// Provides transition support for list items.
2
4
// supports move transitions using the FLIP technique.
3
5
@@ -29,7 +31,7 @@ delete props.mode
29
31
export default {
30
32
props,
31
33
32
- render ( h ) {
34
+ render ( h : Function ) {
33
35
const tag = this . tag || this . $vnode . data . tag || 'span'
34
36
const map = Object . create ( null )
35
37
const prevChildren = this . prevChildren = this . children
@@ -127,7 +129,7 @@ export default {
127
129
} ,
128
130
129
131
methods : {
130
- hasMove ( el , moveClass ) {
132
+ hasMove ( el : Element , moveClass : string ) : boolean {
131
133
/* istanbul ignore if */
132
134
if ( ! hasTransition ) {
133
135
return false
Original file line number Diff line number Diff line change
1
+ /* @flow */
2
+
1
3
// Provides transition support for a single element/component.
2
4
// supports transition mode (out-in / in-out)
3
5
@@ -18,7 +20,7 @@ export const transitionProps = {
18
20
appearActiveClass : String
19
21
}
20
22
21
- export function extractTransitionData ( comp ) {
23
+ export function extractTransitionData ( comp : Component ) : Object {
22
24
const data = { }
23
25
const options = comp . $options
24
26
// props
@@ -38,7 +40,7 @@ export default {
38
40
name : 'transition' ,
39
41
props : transitionProps ,
40
42
_abstract : true ,
41
- render ( h ) {
43
+ render ( h : Function ) {
42
44
let children = this . $slots . default
43
45
if ( ! children ) {
44
46
return
@@ -91,10 +93,11 @@ export default {
91
93
// apply transition data to child
92
94
// use getRealChild() to ignore abstract components e.g. keep-alive
93
95
const child = getRealChild ( rawChild )
96
+ if ( ! child ) return
94
97
child . key = child . key || `__v${ child . tag + this . _uid } __`
95
98
const data = ( child . data || ( child . data = { } ) ) . transition = extractTransitionData ( this )
96
99
const oldRawChild = this . _vnode
97
- const oldChild = getRealChild ( oldRawChild )
100
+ const oldChild : any = getRealChild ( oldRawChild )
98
101
99
102
// handle transition mode
100
103
if ( mode && oldChild && oldChild . data && oldChild . key !== child . key ) {
You can’t perform that action at this time.
0 commit comments