@@ -81,11 +81,9 @@ function enter (_, vnode) {
81
81
el . _enterCb = null
82
82
} )
83
83
84
- // remove pending leave element on enter by injecting an insert hook
85
- // mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', () => {
86
-
87
- // }, 'transition-insert')
88
-
84
+ // We need to wait until the native element has been inserted, but currently
85
+ // there's no API to do that. So we have to wait "one frame" - not entirely
86
+ // sure if this is guaranteed to be enough (e.g. on slow devices?)
89
87
setTimeout ( ( ) => {
90
88
const parent = el . parentNode
91
89
const pendingNode = parent && parent . _pending && parent . _pending [ vnode . key ]
@@ -98,7 +96,7 @@ function enter (_, vnode) {
98
96
enterHook && enterHook ( el , cb )
99
97
100
98
if ( endState ) {
101
- const animation = vnode . context . $options . animation
99
+ const animation = vnode . context . _requireWeexModule ( ' animation' )
102
100
animation . transition ( el . ref , {
103
101
styles : endState ,
104
102
duration : 300 ,
@@ -107,17 +105,6 @@ function enter (_, vnode) {
107
105
} else if ( ! userWantsControl ) {
108
106
cb ( )
109
107
}
110
- // if (expectsCSS) {
111
- // animation.transition(el.ref, {
112
- // styles: startState
113
- // }, () => {
114
- // animation.transition(el.ref, {
115
- // styles: endState,
116
- // duration: 300,
117
- // timingFunction: 'ease-in-out'
118
- // }, userWantsControl ? noop : cb)
119
- // })
120
- // }
121
108
} , 16 )
122
109
123
110
// start enter transition
@@ -193,7 +180,7 @@ function leave (vnode, rm) {
193
180
}
194
181
195
182
function performLeave ( ) {
196
- const animation = vnode . context . $options . animation
183
+ const animation = vnode . context . _requireWeexModule ( ' animation' )
197
184
// the delayed leave may have already been cancelled
198
185
if ( cb . cancelled ) {
199
186
return
0 commit comments