Test3.vue 717 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div>
  3. <button @click="isShow = !isShow">显示/隐藏</button>
  4. <transition-group
  5. appear
  6. name="animate__animated animate__bounce"
  7. enter-active-class="animate__swing"
  8. leave-active-class="animate__backOutUp"
  9. >
  10. <h1 v-show="!isShow" key="1">你好啊!</h1>
  11. <h1 v-show="isShow" key="2">尚硅谷!</h1>
  12. </transition-group>
  13. </div>
  14. </template>
  15. <script>
  16. import 'animate.css'
  17. export default {
  18. name:'Test',
  19. data(){
  20. return{
  21. isShow:true
  22. }
  23. }
  24. }
  25. </script>
  26. <style scoped>
  27. h1{
  28. background-color: orange;
  29. }
  30. </style>