From f8e9af35a267b7b9a2bf605187a11536889a6e38 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Mon, 20 May 2024 11:00:10 +0800
Subject: [PATCH] 修改:绑定银行卡 多语言

---
 src/components/elalert.vue |   36 +++++++++++++++++-------------------
 1 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/src/components/elalert.vue b/src/components/elalert.vue
index bd677ab..275f6df 100644
--- a/src/components/elalert.vue
+++ b/src/components/elalert.vue
@@ -1,7 +1,10 @@
 <!--  -->
 <template>
-    <el-alert v-show="alertShow" :closable="closable" :title="texts" :type="elType" center>
+    <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>
+    </div>
+    
 </template>
 
 <script>
@@ -31,21 +34,22 @@
     },
     //监听alertShow变成true时,2秒后自动关闭
     watch: {
-        alertShow: function (val) {
+        // 监听vuex中的elAlertShow变化
+        '$store.state.elAlertShow': function (val) {
             if (val) {
                 setTimeout(() => {
-                    this.$emit('closeAlert')
+            this.$store.commit('elAlertShow', {'elAlertShow':false});
                 }, 2000)
             }
         }
     },
     //生命周期 - 创建完成(访问当前this实例)
     created() {
-
+        
     },
     //生命周期 - 挂载完成(访问DOM元素)
     mounted() {
-
+        
     },
     methods:{
         //定时调用父组件方法关闭弹窗
@@ -54,25 +58,19 @@
             setTimeout(()=>{
                 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;
+
+
+.tit {
+    width: 1rem;
+    height: 1rem;
+    position: absolute;
+    top: 50%;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3