<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Title</title>
<script src="js/vue-2.4.0.js"></script>
<link rel="stylesheet" href="css/animate.css">
</head>
<body>
<div id="app">
<input type="button" value="toggle" @click="flag=!flag">
<!--使用第三方设置-->
<!--<transition enter-active-class="animated bounceIn" leave-active-class="animated bounceOut">-->
<!--<h3 v-if="flag">这是一个h3</h3>-->
<!--</transition>-->
<!--使用 :duration="毫秒值" 来统一设置入场和离场的动画时间-->
<!--<transition enter-active-class="bounceIn" leave-active-class="bounceOut" :duration="200">-->
<!--<h3 v-if="flag" class="animated">这是一个h3</h3>-->
<!--</transition>-->
<!--使用 :duration="{enter:毫秒值,leave:毫秒值}" 来分别设置 入场时长和离场时长-->
<transition enter-active-class="bounceIn" leave-active-class="bounceOut" :duration="{ enter:200,leave:500}">
<h3 v-if="flag" class="animated">这是一个h3</h3>
</transition>
</div>
<script>
const vm=new Vue({
el:'#app',
data:{
flag:false
},
methods:{}
})
</script>
</body>
</html>