From 334b53809270eb84cb48b7490b429b3764d35ebf Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Wed, 26 Mar 2025 12:07:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20WechatModal=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=8F=E6=98=8E=E5=BA=A6=E5=92=8C=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E5=8A=A8=E7=94=BB=E7=9A=84=E8=BF=87=E6=B8=A1=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=EF=BC=8C=E4=BB=A5=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/WechatModal.vue | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/WechatModal.vue b/src/components/WechatModal.vue index dff47be..be66c8e 100644 --- a/src/components/WechatModal.vue +++ b/src/components/WechatModal.vue @@ -208,7 +208,6 @@ onUnmounted(() => { display: grid; place-items: center; backdrop-filter: blur(8px); - opacity: 0; transition: opacity 0.2s ease; isolation: isolate; } @@ -226,9 +225,8 @@ onUnmounted(() => { border-radius: 12px; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); overflow: hidden; - opacity: 0; transform: scale(0.95); - transition: all 0.2s ease; + transition: transform 0.2s ease, opacity 0.2s ease; z-index: v-bind('zIndex + 1'); } @@ -407,24 +405,26 @@ onUnmounted(() => { } /* 过渡动画 */ -.wechat-modal-enter-active .wechat-modal-mask { - opacity: 1; +.wechat-modal-enter-active, +.wechat-modal-leave-active { + transition: opacity 0.2s ease; } -.wechat-modal-enter-active .wechat-modal-container { - opacity: 1; - transform: scale(1); -} - -.wechat-modal-leave-active .wechat-modal-mask { +.wechat-modal-enter-from, +.wechat-modal-leave-to { opacity: 0; } -.wechat-modal-leave-active .wechat-modal-container { - opacity: 0; +.wechat-modal-enter-from .wechat-modal-container, +.wechat-modal-leave-to .wechat-modal-container { transform: scale(0.95); } +.wechat-modal-enter-to .wechat-modal-container, +.wechat-modal-leave-from .wechat-modal-container { + transform: scale(1); +} + /* 响应式布局 */ @media (max-width: 360px) { .wechat-modal-container {