wujingjing
2024-11-14 118e03d7df7fc427f529439dfbfcf8a6274d206a
src/layout/component/main.vue
@@ -9,9 +9,18 @@
         wrap-class="layout-main-scroll  flex"
         view-class="layout-main-scroll bg-[#1c1e1d]  flex h100 w-full"
      >
         <SideBar />
         <div class="flex-auto flex-col flex right-container">
            <Header class="flex-0" />
         <SideBar v-if="!isSharePage && sidebarIsShow" :isShow="sidebarIsShow" @toggleSidebar="toggleSidebar"/>
         <div
            class="flex-auto flex-col flex right-container"
            :class="{
               // 'm-[6px]': !isSharePage,
               // 'rounded-[10px]': !isSharePage,
               'bg-[#1c1e1d]': !isSharePage,
               'bg-[#f7f8fa]': isSharePage,
            }"
         >
            <Header v-if="!isSharePage" class="flex-0" @toggleSidebar="toggleSidebar" :sidebarIsShow="sidebarIsShow"/>
            <ShareHeader v-else class="flex-0"></ShareHeader>
            <LayoutParentView class="flex-auto" />
         </div>
      </el-scrollbar>
@@ -24,15 +33,18 @@
import { computed, defineAsyncComponent, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import Header from './header/Header.vue';
import ShareHeader from './header/ShareHeader.vue';
import SideBar from './sidebar/Sidebar.vue';
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
import { useThemeConfig } from '/@/stores/themeConfig';
import { NextLoading } from '/@/utils/loading';
import { isSharePage } from '/@/stores/chatRoom';
import { Local } from '/@/utils/storage';
// 引入组件
const LayoutParentView = defineAsyncComponent(() => import('/@/layout/routerView/parent.vue'));
const LayoutFooter = defineAsyncComponent(() => import('/@/layout/footer/index.vue'));
// 定义变量内容
const layoutMainScrollbarRef = ref();
const route = useRoute();
@@ -70,6 +82,14 @@
defineExpose({
   layoutMainScrollbarRef,
});
//#region ====================== 侧边栏显示隐藏 ======================
const sidebarIsShow = ref(!!Local.get('sidebarIsShow'));
const toggleSidebar = (val) => {
   sidebarIsShow.value = val;
   Local.set('sidebarIsShow',val)
};
//#endregion
</script>
<style scoped lang="scss">
@@ -80,9 +100,9 @@
   overflow: hidden;
   -webkit-box-sizing: border-box;
   box-sizing: border-box;
   background-color: #1c1e1d;
   // background-color: #1c1e1d;
   font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
   margin: 6px;
   border-radius: 10px;
   // margin: 6px;
   // border-radius: 10px;
}
</style>