<template>
    <transition
        appear
        name="custom-classes-transition"
        enter-active-class="animated fadeIn faster"
        leave-active-class="animated fadeOut faster"
    >
        <popup v-if="show" :is-pass="true">
            <div class="ui-message-tips" :style="{fontSize:fontSize}" v-html="content"></div>
        </popup>
    </transition>
</template>
<script>
import Popup from "../popup";
export default {
    name: "ui-tips",
    components: {
        Popup
    },
    data() {
        return {
            show: false,
            duration: 2000,
            content: "",
            fontSize:''
        };
    },
    mounted() {
        setTimeout(() => {
            this.show = false;
            this.$nextTick(function() {
                document.body.removeChild(this.$el);
                this.$destroy(true);
            });
        }, this.duration);
    }
};
</script>
<style lang="less" scoped>
.ui-message-tips {
    position: absolute;
    left: 50%;
    top: 100px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    transform: translate(-50%, -40%);
    border-radius: 10px;
    box-shadow: 0 0px 35px rgba(0, 0, 0, 0.3);
}
[show-mode="mobile"],
[edit-mode="mobile"] {
    .ui-message-tips {
         top: 40%;
         padding: 25px 10px;
         width: 60%;
         text-align: center;
         line-height: 1.8;
    }
}
</style>