«

Vue动画和animate.Css相结合

emer 发布于 2017-6-20 16:09   3445 次阅读     


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动画2</title>
    <script src="bower_components/vue/dist/vue.js"></script>
        <link rel="stylesheet" href="bower_components/animate.css/animate.css">
</head>
<body>
    <div id="box">
        <input type="button" value="运动" @click="toggle()">
        <div id="app" transition="bounce" v-show="bsign" class="animated">

        </div>
    </div>
</body>
<style> 
#box{
    width: 400px;
    margin:20px auto;

}
#app{
    background: red;
    height: 100px;
    width: 100px;
    margin-top: 50px;
}
</style>
<script>
    new Vue({
        el:"#box",
    data:{
        bsign:true
    },
    methods:{
       toggle:function(){
           return this.bsign=!this.bsign
       }
    },transitions:{
        bounce:{
            enterClass:"zoomInLeft",
            leaveClass:"rubberBand"
        }
    }
    })
</script>
</html>