当前位置: 首页 > news >正文

animatecss动画效果

1. 官网

https://animatecss.node.org.cn/

2. 安装

npm install animate.css --save

  1. 使用时需要在vue中引入:import "animate.css;
  2. 与内置组件配合使用: <Transition>Vue官网链接
  3. 如果按照animatecss官网的用法,则只能指定进入或退出其中一个动画效果
 <h1 class="animate__animated animate__bounce">An animated element</h1>

3. 使用

3.1 代码

<template><button @click="flag = !flag">切换组件</button><br /><TransitionleaveActiveClass="animate__animated animate__zoomOut"enterActiveClass="animate__animated animate__rotateIn"><divstyle="width: 200px; width: 200px; background-color: red"v-if="flag"></div></Transition></template><script setup lang="ts">
import { ref } from "vue";
import "animate.css";
const flag = ref(true);
</script><style scoped lang="scss">
// 调整动画的时间
.animate__animated.animate__zoomOut {--animate-duration: 1s;
}
</style>

3.2 效果

在这里插入图片描述

3.3 动画时间

  1. 写在标签里
  • 入和出的动画时间都是2000ms
  <Transition:duration="2000"leaveActiveClass="animate__animated animate__zoomOut"enterActiveClass="animate__animated animate__rotateIn">
  • 入的动画时间是1000,出的是2000
  <Transition:duration="{enter: 1000, leave: 2000}"leaveActiveClass="animate__animated animate__zoomOut"enterActiveClass="animate__animated animate__rotateIn">
  1. 写在<style>
<style scoped lang="scss">
.animate__animated.animate__zoomOut {--animate-duration: 1s;
}

3.3 需要注意的地方

在这里插入图片描述


http://www.mrgr.cn/news/3631.html

相关文章:

  • 自行车制造5G智能工厂工业物联数字孪生平台,推进制造业数字化
  • LSPosed模块开发第二篇 hook Webview
  • VSCode配置ssh免密连接远程服务器
  • MySQL——高级查询(1)聚合函数
  • 【数据分析---偏企业】 Excel操作
  • 怎么对前端的一些按钮做一个权限校验
  • 基于jqury和canvas画板技术五子棋游戏设计与实现(论文+源码)_kaic
  • 【微信小程序】自定义组件 - 插槽
  • 不同mcu间实现数据交互的字符串数据处理
  • 自抗扰控制ADRC原理解析及案例应用
  • 关于SOA和微服务
  • Nginx高级配置——gzip
  • 一款基于BS的美食网站的设计与实现
  • 【Python开发实践】AI人机对战五子棋——程序调用及运行效果
  • kafka开启kerberos
  • 【代码随想录训练营第42期 Day32打卡 - 从零开始动态规划 - LeetCode 509. 斐波那契数 70. 爬楼梯 746. 使用最小花费爬楼梯
  • 0821作业+思维导图
  • 【Rust光年纪】从zlib到LZ4:探索Rust语言中的数据压缩和解压实现
  • 《图解设计模式》笔记(三)生成实例
  • 删除 Instagram 账户