微信小程序 ,popup 的属性 visible 接收的是boolean值,但是监听里面是处理的对象,导致关闭popup的时候动画消失 #1347
Open
Description
onAnimationEnd() {
const { closing } = this.data;
if (closing) {
this.setData({ closing: false });
}
const [visible, duration, animation] = getValueFromProps(this, [
'visible',
'duration',
'animation',
]);
const enableAnimation = animation && duration > 0;
if (enableAnimation) {
triggerEventOnly(this, visible ? 'afterShow' : 'afterClose');
}
/// #if WECHAT
observers: {
'visible': function (nextProps) {
const { visible, duration, animation } = nextProps;
const enableAnimation = animation && duration > 0;
if (enableAnimation && !visible && !this.data.closing) {
this.setData({ closing: true });
}
if (!enableAnimation) {
triggerEventOnly(this, visible ? 'afterShow' : 'afterClose');
}
},
},
/// #endif
Metadata
Assignees
Labels
No labels