1.npm install animate.css

2.在main.js引入 

import animate from 'animate.css'

Vue.use(animate);

<template>
 <transition name="zoom">
  <slot></slot>
 </transition>
</template>

<script>
    export default {
        name:'FadeAnimation'
    }
</script>

<style scoped>
  .zoom-enter-active{
   animation :zoomIn .5s
   }
   .zoom-leave-active{
    animation :zoomOut .5s
   }
</style>

 

3.使用方式

封装好组件并

<fade-animation>

<common-gallary

:imgs="bannerImgs"

v-show="showGallary"

@close="handleGallaryClose"

></common-gallary>

</fade-animation>

 

Logo

前往低代码交流专区

更多推荐