zoukankan      html  css  js  c++  java
  • vue2.0-transition配合animate.css

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>智能社——http://www.zhinengshe.com</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <style>
            p{
                width:100px;
                height:100px;
                background: red;
                margin:0 auto;
            }
        </style>
        <script src="vue.js"></script>
        <link rel="stylesheet" href="animate.css">
        <script>
            window.onload=function(){
                new Vue({
                    el:'#box',
                    data:{
                        show:false
                    }
                });
            };
        </script>
    </head>
    <body>
        <div id="box">
            <input type="button" value="点击显示隐藏" @click="show=!show">
    
            <transition enter-active-class="bounceInLeft" leave-active-class="bounceOutRight">
                <p v-show="show" class="animated"></p>
            </transition>
        </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>智能社——http://www.zhinengshe.com</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <style>
            p{
                width:100px;
                height:100px;
                background: red;
                margin:0 auto;
            }
        </style>
        <script src="vue.js"></script>
        <link rel="stylesheet" href="animate.css">
        <script>
            window.onload=function(){
                new Vue({
                    el:'#box',
                    data:{
                        show:false
                    }
                });
            };
        </script>
    </head>
    <body>
        <div id="box">
            <input type="button" value="点击显示隐藏" @click="show=!show">
    
            <transition enter-active-class="zoomInLeft" leave-active-class="zoomOutRight">
                <p v-show="show" class="animated"></p>
            </transition>
        </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>智能社——http://www.zhinengshe.com</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <style>
            p{
                width:100px;
                height:100px;
                background: red;
                margin:0 auto;
            }
        </style>
        <script src="vue.js"></script>
        <link rel="stylesheet" href="animate.css">
        <script>
            window.onload=function(){
                new Vue({
                    el:'#box',
                    data:{
                        show:false
                    }
                });
            };
        </script>
    </head>
    <body>
        <div id="box">
            <input type="button" value="点击显示隐藏" @click="show=!show">
    
            <transition enter-active-class="animated zoomInLeft" leave-active-class="animated zoomOutRight">
                <p v-show="show"></p>
            </transition>
        </div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>智能社——http://www.zhinengshe.com</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <style>
            p{
                width:100px;
                height:100px;
                background: red;
                margin:0 auto;
            }
        </style>
        <script src="vue.js"></script>
        <link rel="stylesheet" href="animate.css">
        <script>
            window.onload=function(){
                new Vue({
                    el:'#box',
                    data:{
                        show:false
                    },
                    transitions:{ //错的
                        enterActiveClass:'zoomInLeft',
                        leaveActiveClass:'zoomOutRight'
                    }
                });
            };
        </script>
    </head>
    <body>
        <div id="box">
            <input type="button" value="点击显示隐藏" @click="show=!show">
    
            <transition name="transitions">
                <p v-show="show" class="animated"></p>
            </transition>
        </div>
    </body>
    </html>
  • 相关阅读:
    html/form表单常用属性认识
    css复杂动画(animation属性)
    css样式水平居中和垂直居中的方法
    css简单动画(transition属性)
    html/css中map和area的应用
    html/css弹性布局的几大常用属性详解
    webpack优化配置
    webpack配置详解
    使用Node.js搭建一个简单的web服务器(二):搭建一个简单的服务器
    使用Node.js搭建一个简单的web服务器(一):Node.js入门
  • 原文地址:https://www.cnblogs.com/yaowen/p/6987654.html
Copyright © 2011-2022 走看看