67 lines
2.0 KiB
Vue
Raw Normal View History

2024-04-18 00:24:07 +08:00
<template>
2024-05-04 23:36:38 +08:00
<a-watermark :content="watermark" v-bind="watermarkConfig">
<a-layout-content :class="isFooter ? 'content' : 'content-no-footer'">
<Tabs v-if="isTabs" />
<a-scrollbar style="height: 100%; overflow: auto" :outer-class="isTabs ? 'scrollbar' : 'scrollbar-no-tabs'">
2024-05-26 17:33:51 +08:00
<div>
2024-05-04 23:36:38 +08:00
<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>
2024-04-18 00:24:07 +08:00
</template>
<script setup lang="ts">
import Tabs from "@/layout/components/Tabs/index.vue";
2024-04-21 00:26:49 +08:00
import { storeToRefs } from "pinia";
import { useThemeConfig } from "@/store/modules/theme-config";
import { useRoutesListStore } from "@/store/modules/route-list";
2024-04-21 17:09:20 +08:00
const themeStore = useThemeConfig();
2024-05-04 23:36:38 +08:00
let { refreshPage, isTabs, isFooter, watermark, watermarkStyle, watermarkRotate, watermarkGap } = storeToRefs(themeStore);
2024-04-21 00:26:49 +08:00
const routerStore = useRoutesListStore();
const { cacheRoutes } = storeToRefs(routerStore);
2024-05-04 23:36:38 +08:00
// 水印配置
const watermarkConfig = computed(() => {
return {
font: watermarkStyle.value,
rotate: watermarkRotate.value,
gap: watermarkGap.value
};
});
watch(watermarkConfig, newv => {
console.log(newv);
});
2024-04-18 00:24:07 +08:00
</script>
<style lang="scss" scoped>
.content {
2024-05-03 18:05:14 +08:00
height: calc(100vh - 60px - 30px); // 动态切类名-去掉header、footer
2024-04-18 00:24:07 +08:00
}
2024-05-03 18:05:14 +08:00
.content-no-footer {
height: calc(100vh - 60px); // 动态切类名-去掉footer
}
2024-04-18 00:24:07 +08:00
.scrollbar {
2024-05-03 18:05:14 +08:00
height: calc(100% - 40px); // 去掉tabs的高度
2024-05-18 16:42:11 +08:00
background: $color-fill-1; // 背景颜色
2024-05-03 18:05:14 +08:00
}
.scrollbar-no-tabs {
height: 100%;
2024-05-18 16:42:11 +08:00
background: $color-fill-1; // 背景颜色
2024-04-18 00:24:07 +08:00
}
2024-05-03 18:05:14 +08:00
2024-04-18 00:24:07 +08:00
// 修改左侧滚动条宽度
:deep(.arco-scrollbar-thumb-direction-vertical .arco-scrollbar-thumb-bar) {
width: 4px;
margin-left: 8px;
}
</style>