html页面
<template>
<div class="wrap" v-if="showWrap" :class="showContent ?'fadein':'fadeout'">{
{text}}</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
.wrap{
position: fixed;
left: 50%;
top:50%;
width: 60%;
background: rgba(0,0,0,0.5);
padding: 1rem 0rem;
text-align: center;
border-radius: 10rem;
font-size: 1.4rem;
transform: translate(-50%,-50%);
color:#fff;
}
.fadein {
animation: animate_in 0.25s;
}
.fadeout {
animation: animate_out 0.25s;
opacity: 0;
}
@keyframes animate_in {
0% {
opacity: 0;
}
100%{
opacity: 1;
}
}
@keyframes animate_out {
0% {
opacity: 1;
}