zoom.vue 926 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div>
  3. <el-button @click="show = !show">Click Me</el-button>
  4. <div style="display: flex; margin-top: 20px; height: 100px">
  5. <transition name="el-zoom-in-center">
  6. <div v-show="show" class="transition-box">.el-zoom-in-center</div>
  7. </transition>
  8. <transition name="el-zoom-in-top">
  9. <div v-show="show" class="transition-box">.el-zoom-in-top</div>
  10. </transition>
  11. <transition name="el-zoom-in-bottom">
  12. <div v-show="show" class="transition-box">.el-zoom-in-bottom</div>
  13. </transition>
  14. </div>
  15. </div>
  16. </template>
  17. <script lang="ts" setup>
  18. import { ref } from 'vue'
  19. const show = ref(true)
  20. </script>
  21. <style>
  22. .transition-box {
  23. margin-bottom: 10px;
  24. width: 200px;
  25. height: 100px;
  26. border-radius: 4px;
  27. background-color: #409eff;
  28. text-align: center;
  29. color: #fff;
  30. padding: 40px 20px;
  31. box-sizing: border-box;
  32. margin-right: 20px;
  33. }
  34. </style>