vue过渡和animate.css结合使用

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动画</title>
    <script type="text/javascript" src="vue.js"></script>
    <link rel="stylesheet" type="text/css" href="animate.css">
    <style type="text/css">
        p {
            width: 300px;
            height: 300px;
            background: red;
            margin: 10px auto;
        }
    </style>
    <script type="text/javascript">
        window.onload = function(){
            var app = new Vue({
                el:‘#box‘,
                data:{
                    show:false
                }
            })
        }
    </script>
</head>
<body>
    <div id="box">
        <!-- 控制数据的值切换显示隐藏 -->
        <button @click="show=!show">transition</button>

        <!-- <transition enter-active-class="zoomInLeft" leave-active-class="zoomOutRight">
            <p v-show="show" class="animated"></p>
        </transition> -->

        <!-- 第二种方法 -->
        <!-- <transition enter-active-class="animated zoomInLeft" leave-active-class="animated zoomOutRight">
            <p v-show="show"></p>
        </transition> -->

        <!-- 多元素运动 -->
        <transition-group enter-active-class="zoomInLeft" leave-active-class="zoomOutRight">
            <p v-show="show" class="animated" :key="1"></p>
            <p v-show="show" class="animated" :key="2"></p>
        </transition-group>
    </div>
</body>
</html>
时间: 2024-08-09 06:33:38

vue过渡和animate.css结合使用的相关文章

在Vue中使用 animate.css 库

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>在Vue中使用 animate.css 库</title> <script src="./vue.js"></script> <link rel="stylesheet" type=&qu

3. vue中导入animate.css动画库、Swiper轮播图组件

1. vue中导入animate.css动画库 2. vue中使用Swiper轮播图插件 注意:swiper常用设置 原文地址:https://www.cnblogs.com/qfshini/p/12120612.html

在vue中使用animate.css

animate.css是一款前端动画库,相似的有velocity-animate 用法: 首先 npm install animate.css --save 然后在vue文件的script中引入: import $ from '../assets/js/jquery.js'; import animate from 'animate.css' 最后绑定元素使用: <template> <div class="song"> <p id="f&quo

vue中使用animate.css实现动画

1.npm install animate.css --save2.在main.js中 import animate from 'animate.css'; 3.使用: animated 不能漏 <view class="content animated fadeInRight"> 4. fade: { title: '淡入淡出', fadeIn: '淡入', fadeInDown: '向下淡入', fadeInDownBig: '向下快速淡入', fadeInLeft:

vue animate.css训练动画案例 列表循环

制作目标动画:向上入场添加数据,点击数据右滑动离场 简单页面效果: 实现代码如下: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="css/animate.css"/>

vue+ webpack中的animate.css实现的执行多个连续的动画

1.安装 npm install animate.css 2.使用方法 入口文件App中进行引入 import animate from 'animate.css' 3.多个连续的动画 实现的效果:实现了三个蓝色方块依次以不同效果展现出来. 模板中代码: <template> <div class="hello"> <div class="box rotateIn" style="animation-duration:2s;a

vue使用animate.css

1.在main.js中引入animate.css import './assets/animate.css' 2.使用transition标签包裹运动的元素,使用enter-active-class定义进入动画,使用leave-active-class定义离开动画,注意animate.css的所有动画要加animated这个类 <transition enter-active-class="animated bounce" leave-active-class="ani

Vue 过渡

过渡 通过 Vue.js 的过渡系统,可以在元素从 DOM 中插入或移除时自动应用过渡效果.Vue.js 会在适当的时机为你触发 CSS 过渡或动画,你也可以提供相应的 JavaScript 钩子函数在过渡过程中执行自定义的 DOM 操作. 为了应用过渡效果,需要在目标元素上使用 transition 特性: <div v-if="show" transition="my-transition"></div> transition 特性可以与

node.js里面的声明周期和animate.css动画

1声明周期<template><div id="lifeinfo"><p>组件的生命周期</p><button @click="changeData">修改数据</button><p>{{msg}}</p></div></template><script>export default {name: "lifeinfo"