fade.vue 777 B

1234567891011121314151617181920212223242526272829303132333435
  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-fade-in-linear">
  6. <div v-show="show" class="transition-box">.el-fade-in-linear</div>
  7. </transition>
  8. <transition name="el-fade-in">
  9. <div v-show="show" class="transition-box">.el-fade-in</div>
  10. </transition>
  11. </div>
  12. </div>
  13. </template>
  14. <script lang="ts" setup>
  15. import { ref } from 'vue'
  16. const show = ref(true)
  17. </script>
  18. <style>
  19. .transition-box {
  20. margin-bottom: 10px;
  21. width: 200px;
  22. height: 100px;
  23. border-radius: 4px;
  24. background-color: #409eff;
  25. text-align: center;
  26. color: #fff;
  27. padding: 40px 20px;
  28. box-sizing: border-box;
  29. margin-right: 20px;
  30. }
  31. </style>