2019-01-12 11:33:27 +08:00
|
|
|
import animate from './css-animation';
|
2018-02-05 19:12:41 +08:00
|
|
|
const getTransitionProps = (transitionName, opt = {}) => {
|
|
|
|
const transitionProps = {
|
2020-06-11 18:27:27 +08:00
|
|
|
appear: true,
|
|
|
|
css: false,
|
|
|
|
onEnter: (el, done) => {
|
|
|
|
animate(el, `${transitionName}-enter`, done);
|
2018-02-05 19:12:41 +08:00
|
|
|
},
|
2020-06-11 18:27:27 +08:00
|
|
|
onLeave: (el, done) => {
|
|
|
|
animate(el, `${transitionName}-leave`, done);
|
2018-02-05 19:12:41 +08:00
|
|
|
},
|
2020-06-11 18:27:27 +08:00
|
|
|
...opt,
|
2019-01-12 11:33:27 +08:00
|
|
|
};
|
|
|
|
return transitionProps;
|
|
|
|
};
|
2018-02-05 19:12:41 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
export default getTransitionProps;
|