<template>
    <transition name="fade">
        <div class="toast" v-show="show" v-html="message"><!-- 使用v-html，展示多样化样式内容 -->
            <!-- {{message}} --><!-- 若仅展示固定样式文本，使用此方式 -->
        </div>

    </transition>
</template>

<script>
    export default {
        data() {
            return {
                show: false,
                message: "",
            }
        }
    }
</script>

<style scoped lang="scss">
.toast {
  position: fixed;
  top: 42%;
  left: 50%;
  padding: 63px 74px;
  margin-left: -200px;    /* 宽度的一半 */  
  background: #000000;
  border: 1px solid #5F5F5F;
  opacity: 0.8;
  border-radius: 40px;
  z-index: 999;
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 48px;
  text-align: center;
}

.fade-enter-active,
.fade-leave-active {
  transition: 0.3s ease-out;
}
.fade-enter {
  opacity: 0;
  transform: scale(1.2);
}
.fade-leave-to {
  opacity: 0;
  transform: scale(0.8);
}
</style>