wujingjing
2025-03-03 26e2d14957500f4f738945d4c71d1288a72c85cb
src/layout/component/main.vue
@@ -7,22 +7,24 @@
         ref="layoutMainScrollbarRef"
         class="layout-main-scroll layout-backtop-header-fixed"
         wrap-class="layout-main-scroll  flex"
         view-class="layout-main-scroll bg-[#1c1e1d]  flex h100 w-full"
         view-class="layout-main-scroll bg-[var(--color-bg-side)]  flex h100 w-full"
      >
         <SideBar v-if="!isSharePage" />
         <SideBar v-if="!isSharePage && sidebarIsShow" :isShow="sidebarIsShow" @toggleSidebar="toggleSidebar" />
         <SidebarOther 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,
               // 'm-[6px]': !isSharePage,
               // 'rounded-[10px]': !isSharePage,
               'bg-[var(--color-bg-side)]': !isSharePage,
               'bg-[#f7f8fa]': isSharePage,
            }"
         >
            <Header v-if="!isSharePage" class="flex-0" />
            <Header v-if="!isSharePage" class="flex-0" :sidebarIsShow="sidebarIsShow" />
            <ShareHeader v-else class="flex-0"></ShareHeader>
            <LayoutParentView class="flex-auto" />
         </div>
         <Login v-show="isShowLogin" />
      </el-scrollbar>
      <el-backtop :target="setBacktopClass" />
   </el-main>
@@ -35,12 +37,14 @@
import Header from './header/Header.vue';
import ShareHeader from './header/ShareHeader.vue';
import Login from './login/Login.vue';
import SideBar from './sidebar/Sidebar.vue';
import SidebarOther from './sidebar/SidebarOther.vue';
import { isSharePage, isShowLogin } from '/@/stores/chatRoom';
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'));
@@ -51,7 +55,6 @@
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes);
// 设置 footer 显示/隐藏
const isFooter = computed(() => {
   return themeConfig.value.isFooter && !route.meta.isIframe;
@@ -81,6 +84,14 @@
defineExpose({
   layoutMainScrollbarRef,
});
//#region ====================== 侧边栏显示隐藏 ======================
const sidebarIsShow = ref(Local.get('sidebarIsShow') ?? true);
const toggleSidebar = (val) => {
   sidebarIsShow.value = val;
   Local.set('sidebarIsShow', val);
};
//#endregion
</script>
<style scoped lang="scss">