dcc
2024-05-13 912fe7ae136e6c387ee9063974df0a2af8b56a6e
src/components/elalert.vue
@@ -1,10 +1,10 @@
<!--  -->
<template>
    <div v-if="$store.state.elAlertShow">
        <el-alert  :closable="closable" :title="$store.state.elAlertText" :type="$store.state.elAlertType" center style="z-index:99999999999999999;position: fixed;top: 0;bottom: 0;margin: auto;">
        <el-alert  :closable="closable" :title="$t($store.state.elAlertText)" :type="$store.state.elAlertType" center style="z-index:99999999999999999;position: fixed;top: 0;bottom: 0;margin: auto;">
    </el-alert>
    </div>
</template>
<script>
@@ -45,11 +45,11 @@
    },
    //生命周期 - 创建完成(访问当前this实例)
    created() {
    },
    //生命周期 - 挂载完成(访问DOM元素)
    mounted() {
    },
    methods:{
        //定时调用父组件方法关闭弹窗
@@ -59,33 +59,18 @@
                this.$emit('closeAlert')
            },2000)
        },
    }
}
</script>
<style scoped lang="less">
/* @import url(); 引入css类 */
/deep/.el-alert{
  width: 70%!important;
  height: 1rem!important;
  position: absolute!important;
  top: 0!important;
  bottom: 0!important;
  left: 0!important;
  right: 0!important;
  margin: auto!important;
  font-size: 0.3rem!important;
}
/deep/.el-alert__title{
  font-size: 0.3rem!important;
}
/deep/.el-icon-close::before{
    display: none;
}
.tit {
    width: 1rem;
    height: 1rem;
    position: absolute;
    top: 50%;
}
</style>
</style>