html - Animate.css 在我的 Vue 3 元素中没有动画

标签 html css vue.js animation animate.css

我只是想在我的 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/

相关文章:

javascript - 是什么导致 Vue props 等于 DOM 中的 [object Object]?

javascript - 如何使用谷歌图表向散点图的点添加渐变颜色填充?

javascript - 有没有办法防止框架覆盖主窗口?

html - 单击使用 Angular 5 时如何使列表组处于事件状态?

mysql - VueJS 中的数组循环所有空值函数

javascript - 内链与vue的链接

html - 如何在激活CKEditor时在HTML5 textarea中显示placeholder属性?

html - 在没有高度的 div 上使用 <br clear=all> 的 CSS 方式?

jQuery UI Accordion 与滑动条冲突

javascript - iPhone Bootstrap 4 Alpha 上不显示下拉菜单