feat: 多布局的main窗口滚动

This commit is contained in:
wf 2024-09-05 12:18:06 +08:00
parent 6e0a7b0884
commit dae1088f4e
3 changed files with 6 additions and 67 deletions

View File

@ -1,63 +0,0 @@
<template>
<a-watermark :content="watermark" v-bind="watermarkConfig">
<a-layout-content class="layout-main-content">
<Tabs v-if="isTabs" />
<a-scrollbar style="height: 100%; overflow: auto" :outer-class="isTabs ? 'scrollbar' : 'scrollbar-no-tabs'">
<div>
<router-view v-slot="{ Component, route }">
<MainTransition>
<keep-alive :include="cacheRoutes">
<component :is="Component" :key="route.name" v-if="refreshPage" />
</keep-alive>
</MainTransition>
</router-view>
</div>
</a-scrollbar>
</a-layout-content>
</a-watermark>
</template>
<script setup lang="ts">
import Tabs from "@/layout/components/Tabs/index.vue";
import { storeToRefs } from "pinia";
import { useThemeConfig } from "@/store/modules/theme-config";
import { useRoutesListStore } from "@/store/modules/route-list";
const themeStore = useThemeConfig();
let { refreshPage, isTabs, watermark, watermarkStyle, watermarkRotate, watermarkGap } = storeToRefs(themeStore);
const routerStore = useRoutesListStore();
const { cacheRoutes } = storeToRefs(routerStore);
//
const watermarkConfig = computed(() => {
return {
font: watermarkStyle.value,
rotate: watermarkRotate.value,
gap: watermarkGap.value
};
});
watch(watermarkConfig, newv => {
console.log(newv);
});
</script>
<style lang="scss" scoped>
.layout-main-content {
height: 100%;
}
.scrollbar {
height: calc(100% - 40px); // tabs
background: $color-fill-1; //
}
.scrollbar-no-tabs {
height: 100%;
background: $color-fill-1; //
}
//
:deep(.arco-scrollbar-thumb-direction-vertical .arco-scrollbar-thumb-bar) {
width: 4px;
margin-left: 8px;
}
</style>

View File

@ -43,4 +43,10 @@ watch(watermarkConfig, newv => {
display: flex;
flex-direction: column;
}
// -main
:deep(.arco-scrollbar-thumb-direction-vertical .arco-scrollbar-thumb-bar) {
width: 4px;
margin-left: 8px;
}
</style>

View File

@ -90,8 +90,4 @@ const sourceTree = ref(fileTreeData.tree);
}
}
}
:deep(.arco-scrollbar-thumb-bar) {
width: 4px;
}
</style>