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