gpt4 book ai didi

css - 在 ReactJs 组件中使用 AnimateCSS

转载 作者:太空宇宙 更新时间:2023-11-04 00:25:07 25 4
gpt4 key购买 nike

我通过 npm install animate.css --save 安装了 Animate.CSS,并将其保存在本地包 ./node_modules 中。

当我在 Github 上阅读 Animate.CSS 文档时,它说只需在我想要制作动画的元素中添加类名,例如 fadeInDown、bouceInDown...etc,但是我不知道需要从本地包中获取类名。

问题:我们如何从本地 Animate.CSS 包中获取类名并将其添加到 ReactJs 组件中?

假设:我有一个如下的 React 组件,我想将类名添加为 animatedounceIn

export class SimpleInfo extends React.Component {
render() {
return(
<div>My information</div>
)
}
}

最佳答案

我有一个非常相似的问题。我创建了一个新的类名,从 animate.css 类中复制了样式,并将添加了 css 样式的新类放在一个reactcsstransitiongroup下。

可能不是您问题的理想答案,但它对我有用。

关于css - 在 ReactJs 组件中使用 AnimateCSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43056211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com