解决办法:
找到public下面的index.html 文件,通过csdn的方式引入animate.css
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css"
/>
在动画使用的页面,可以全局使用
<template>
<div>
<button @click="changeShow">切换动画效果</button>
<transition
enter-active-class="animate__animated animate__zoomIn"
leave-active-class="animate__animated animate__zoomOut"
>
<div v-show="show">当自定义变量show为true时显示(从最小不断变大到原始大小),为false时不断变小直到隐藏</div>
</transition>
</div>
</template>
<script>
export default {
data() {
return {
show: false
}
},
methods: {
changeShow() {
this.show = !this.show
}
}
}
</script>