我只是想在我的 Vue 3 应用程序中做一些基本的 html 动画,但 Animate.css 示例不起作用。
具体来说,在使用 npm install animate.css --save
安装动画 css 依赖项之后示例动画代码 <h1 class="animate__animated animate__bounce">An animated element</h1>
当我的页面加载时没有动画。标题呈现但只是坐在那里,一动不动。
我尝试过其他解决方案,例如 changing windows performance , adding animated
to the class等,但没有奏效。
我看到一些解决方案使用 CDN 链接库,但我认为我不必这样做,因为我使用 npm 来安装它。
我做错了什么?
<template>
<div class="container-fluid" id="app">
<h1 class="animate__animated animate__bounce" style="color:white">An animated element</h1>
</div>
</template>
最佳答案
将 animate.css 导入到你的 main.js 文件中
import 'animate.css';
关于html - Animate.css 在我的 Vue 3 元素中没有动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65633211/