根据错误信息,遇到模块找不到的问题。这意味着你的项目中,找不到名为’animate’的模块。
animate.css使用4.0版本以上的,一定要加前缀animate__。
!!!注意,是两个_
vue官方文档使用的是3.1版本,所以示例代码没有前缀animate__。
<transition-group
enter-active-class="animate__swing"
leave-active-class="animate__backOutUp"
>
<h1 v-show="!isShow" key="1">haha</h1>
</transition-group>
一、检查你的项目中是否安装 了’animate’的模块
1.1 使用npm或者cnpm安装
npm install animate.css --save 或 cnpm install animate.css --save
1.2 使用yarn安装
yarn add animate.css
二、全局引用的话
// main.js
import animated from "animate.css";
Vue.use(animated);
三、局部网页使用的话
import "@/../node_modules/animate.css/animate.css";