<script src="/lib/vue.js"></script>
<style>
/* 进场动画 */
.xby-enter-active {
animation: aaa 1.5s;
}
/* 出场动画 */
.xby-leave-active {
animation: aaa 1.5s reverse;
}
/* 关键帧 */
@keyframes aaa {
0%{
opacity: 0;
transition: translateX(100px);
}
100%{
opacity: 1;
transition: translateX(0px);
}
}
</style>
</head>
<body>
<div id="box">
<button @click="isshow=!isshow">点击</button>
<!-- 加入过度动画 appear:刚开始直接有动画 model:otu-in:先出再进,in-out:先进再出-->
<transition name="xby" appear mode="out-in">
<div v-show="isshow">1111111</div>
</transition>
</div>
<script>
new Vue({
el:"#box",
data:{
isshow:false
}
})
</script>
</body>
</html>
列表过渡:transition-group