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

fix(dialog): add dialog transition #596

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dialog/dialog.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<wxs src="./dialog.wxs" module="_" />

<t-popup
name="dialog"
class="{{classPrefix}}__wrapper"
visible="{{visible}}"
showOverlay="{{showOverlay}}"
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function transition() {
clearTimeout(this.transitionT);
setTimeout(() => {
this.setData({
transitionClass: [`${prefix}-${name}-leave-active ${prefix}-${name}-leave-to`],
transitionClass: `${prefix}-${name}-leave-active ${prefix}-${name}-leave-to`,
});
}, 30);
if (typeof duration === 'number' && duration > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/overlay/overlay.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
width: 100%;
bottom: 0;
background-color: rgba(0, 0, 0, 0.6);
transition: opacity 200ms ease;
transition: opacity 300ms ease;
}

.t-fade-enter {
Expand Down
13 changes: 11 additions & 2 deletions src/popup/popup.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
position: fixed;
z-index: 11500;
max-height: 100vh;
transition: transform 200ms ease;
transition: all 300ms ease;

&__content {
position: relative;
Expand Down Expand Up @@ -77,7 +77,16 @@
}

&.@{popup}--center {
transform: scale(0);
transform: scale(0.6) translate3d(-50%, -50%, 0);
opacity: 0;
}
}

&.@{prefix}-dialog-enter,
&.@{prefix}-dialog-leave-to {
&.@{popup}--center {
transform: scale(0.6) translate3d(-50%, -50%, 0);
opacity: 0;
}
}
}