<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="vue2.4.2.js"></script>
<style>
.text-fade-enter-active,.text-fade-leave-active{
transition:all .6s ease;
}
.text-fade-leave-active{
opacity: 0;
background:rgba(7,17,27,0);
}
.text-fade-enter,.text-fade-leave-to{
opacity: 0;
background:rgba(7,17,27,0);
}
</style>
</head>
<body>
<div id="container">
<transition name="text-fade">
<div v-show="mask">
hello world!
</div>
</transition>
<br>
<button @click="dianwo">click</button>
</div>
<script>
var vm = new Vue({
el:'#container',
data(){
return {
mask:false
}
},
methods:{
dianwo(){
this.mask = true;
}
}
})
</script>
</body>
</html>
vue2.0的动画过渡效果
最新推荐文章于 2024-06-04 02:56:38 发布