fix(Popup): duration prop not work when position is center

This commit is contained in:
陈嘉涵
2020-01-28 21:57:29 +08:00
parent 4fba295ea1
commit 44072e8c3f
4 changed files with 21 additions and 5 deletions
+4 -2
View File
@@ -49,14 +49,16 @@ export default createComponent({
}
const { round, position, duration } = this;
const isCenter = position === 'center';
const transitionName =
this.transition ||
(position === 'center' ? 'van-fade' : `van-popup-slide-${position}`);
(isCenter ? 'van-fade' : `van-popup-slide-${position}`);
const style = {};
if (isDef(duration)) {
style.transitionDuration = `${duration}s`;
const key = isCenter ? 'animationDuration' : 'transitionDuration';
style[key] = `${duration}s`;
}
return (