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

uni-transition 组件,微信小程序端使用内置的 fade 动画,首次显示时没有动画效果。 #994

Open
yeyuqh opened this issue Apr 3, 2025 · 0 comments

Comments

@yeyuqh
Copy link

yeyuqh commented Apr 3, 2025

  • uni-popup 组件的 mask 就有这个问题,打开时 mask 是没有动画的,只有关闭的时候 mask 才有 fade 动画。
<script setup lang="ts">
import { ref } from 'vue'

const show = ref(false)
</script>

<template>
  <view class="flex h-screen w-screen items-center justify-center">
    <button class="bg-white p-3" @click="show = !show">SHOW</button>
  </view>

  <uni-transition
    mode-class="fade" :show="show"
    :styles="{
      position: 'fixed',
      left: 0,
      right: 0,
      bottom: 0,
      zIndex: 900,
      width: '100vw',
      height: '100vh',
      backgroundColor: 'rgba(0, 0, 0, 0.5)',
    }"
  >
    <view class="flex h-screen w-screen items-center justify-center">
      <button class="bg-white p-3" @click="show = !show">HIDE</button>
    </view>
  </uni-transition>
</template>
CleanShot.2025-04-03.at.16.43.09.mp4
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