Explorar el Código

feat: 支持隐藏菜单

wuwenyi hace 4 días
padre
commit
59a7ef9377
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/components/Layout/index.vue

+ 5 - 1
src/components/Layout/index.vue

@@ -1,6 +1,7 @@
 <template>
   <el-container class="layout-container">
-    <Sidebar />
+    <!-- 被 SCRM 等宿主系统内嵌时隐藏左侧菜单(嵌入方自带导航,避免双层菜单) -->
+    <Sidebar v-if="!embedded" />
     <el-container direction="vertical">
       <Navbar />
       <el-main class="main-content">
@@ -13,6 +14,9 @@
 <script setup lang="ts">
 import Sidebar from '@/components/Sidebar/index.vue'
 import Navbar from '@/components/Navbar/index.vue'
+import { isEmbedded } from '@/utils/auth'
+
+const embedded = isEmbedded()
 </script>
 
 <style scoped>