<!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>Document</title>
<style>
.v-leave-active {
animation: eee 2s;
}
@keyframes eee {
0% {
opacity: 1;
font-size: 10px;
color: red;
}
15% {
opacity: 0.8;
font-size: 14px;
color: hotpink;
}
35% {
opacity: 0.6;
font-size: 17px;
color: pink;
}
60% {
opacity: 0.4;
font-size: 20px;
color: blue;
}
80% {
opacity: 0.2;
font-size: 22px;
color: skyblue;
}
100% {
opacity: 0;
font-size: 24px;
color: skyblue;
}
}
</style>
</head>
<body>
<div id="app">
<transition>
<p v-if="isShow">鹅鹅鹅</p>
</transition>
<p v-if="isShow">去想象体格</p>
<p v-if="isShow">白毛浮绿水</p>
<p v-if="isShow">红掌拨青波</p>
<button @click="change">显示隐藏</button>
</div>
<script src="vue.js"></script>
<script>
var vm = new Vue({
el: '#app',
data: {
isShow: true
},
methods: {
change: function() {
this.isShow = !this.isShow;
}
}
});
</script>
</body>
</html>
网友评论