瀏覽代碼

改关闭按钮为展开收起,登录页不显示展开按钮

cxmo 1 年之前
父節點
當前提交
4ec77f3d63
共有 1 個文件被更改,包括 19 次插入8 次删除
  1. 19 8
      src/App.vue

+ 19 - 8
src/App.vue

@@ -1,7 +1,7 @@
 <script setup>
 import { ref,watch } from 'vue'
 import { useRouter } from 'vue-router'
-import { Close } from '@element-plus/icons-vue'
+import { Fold, Expand } from '@element-plus/icons-vue'
 import { getBannerList } from '@/api/auth'
 
 const wwidth=ref(window.innerWidth)
@@ -45,7 +45,14 @@ watch(()=>router.currentRoute.value.path,
             fit="cover"
             :preview-teleported="true"
             />
-        <span class="close-btn" @click="isShowAd = false"><el-icon><Close /></el-icon></span>
+        <span class="ad-btn" @click="isShowAd = false"
+            style="position: absolute;top:0;right:0;"
+        ><el-icon><Expand /></el-icon></span>
+    </div>
+    <div class="ad-btn" @click="isShowAd = true"
+        v-if="router.currentRoute.value.path!=='/login'&&adSrc.length&&!isShowAd" 
+        style="position: fixed;bottom:20px;right:20px;">
+        <el-icon><Fold /></el-icon>
     </div>
   </div>
   
@@ -72,12 +79,16 @@ watch(()=>router.currentRoute.value.path,
     img{
         width:100%;
     }
-    .close-btn{
-        position: absolute;
-        top:5px;
-        right:5px;
-        color:#fff;
-    }
+  }
+  .ad-btn{
+    cursor: pointer;
+    box-sizing: border-box;
+    color: #fff;
+    background-color: rgba(0, 0, 0, 0.4);
+    padding:12px;
+    font-size: 16px;
+    width:40px;
+    height:40px;
   }
 }
 </style>