Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序 ,popup 的属性 visible 接收的是boolean值,但是监听里面是处理的对象,导致关闭popup的时候动画消失 #1347

Open
1369220324 opened this issue Dec 24, 2024 · 0 comments

Comments

@1369220324
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant