fix: don't show transition on first rendering #338
parent
cd2a5d74c3
commit
47f2ec4a67
|
@ -17,7 +17,7 @@ function animate (node, show, done, type) {
|
||||||
height = node.offsetHeight
|
height = node.offsetHeight
|
||||||
// not get offsetHeight when appear
|
// not get offsetHeight when appear
|
||||||
// set it into raf get correct offsetHeight
|
// set it into raf get correct offsetHeight
|
||||||
if (type === 'appear' && height === 0) {
|
if (height === 0) {
|
||||||
appearRequestAnimationFrameId = raf(() => {
|
appearRequestAnimationFrameId = raf(() => {
|
||||||
height = node.offsetHeight
|
height = node.offsetHeight
|
||||||
node.style.height = '0px'
|
node.style.height = '0px'
|
||||||
|
@ -59,9 +59,6 @@ const animation = {
|
||||||
leave (node, done) {
|
leave (node, done) {
|
||||||
return animate(node, false, done)
|
return animate(node, false, done)
|
||||||
},
|
},
|
||||||
appear (node, done) {
|
|
||||||
return animate(node, true, done, 'appear')
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default animation
|
export default animation
|
||||||
|
|
Loading…
Reference in New Issue