fix(Popup): animation

This commit is contained in:
chenjiahan
2020-07-06 15:06:05 +08:00
parent 57e035bb26
commit 7087922d18
3 changed files with 34 additions and 38 deletions
+25 -27
View File
@@ -49,10 +49,6 @@ export default createComponent({
},
render() {
if (!this.shouldRender) {
return;
}
const { round, position, duration } = this;
const isCenter = position === 'center';
@@ -76,29 +72,31 @@ export default createComponent({
onAfterEnter={this.onOpened}
onAfterLeave={this.onClosed}
>
<div
vShow={this.show}
ref="root"
style={style}
class={bem({
round,
[position]: position,
'safe-area-inset-bottom': this.safeAreaInsetBottom,
})}
onClick={this.onClick}
{...this.$attrs}
>
{this.$slots.default?.()}
{this.closeable && (
<Icon
role="button"
tabindex="0"
name={this.closeIcon}
class={bem('close-icon', this.closeIconPosition)}
onClick={this.close}
/>
)}
</div>
{this.shouldRender ? (
<div
vShow={this.show}
ref="root"
style={style}
class={bem({
round,
[position]: position,
'safe-area-inset-bottom': this.safeAreaInsetBottom,
})}
onClick={this.onClick}
{...this.$attrs}
>
{this.$slots.default?.()}
{this.closeable && (
<Icon
role="button"
tabindex="0"
name={this.closeIcon}
class={bem('close-icon', this.closeIconPosition)}
onClick={this.close}
/>
)}
</div>
) : null}
</Transition>
</>
);