mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-26 23:10:18 +08:00
refactor(components): blankLayout引入GlobalContent
This commit is contained in:
41
src/layouts/common/SpacePlaceholder/index.vue
Normal file
41
src/layouts/common/SpacePlaceholder/index.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div v-if="theme.fixedHeaderAndTab" class="space-placholder_height"></div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useThemeStore } from '@/store';
|
||||
|
||||
interface Props {
|
||||
/** 去除tab的高度 */
|
||||
removeHeader?: boolean;
|
||||
/** 去除tab的高度 */
|
||||
removeTab?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
removeHeader: false,
|
||||
removeTab: false
|
||||
});
|
||||
|
||||
const theme = useThemeStore();
|
||||
const spaceHeight = computed(() => {
|
||||
const {
|
||||
multiTabStyle: { visible, height: tabHeight },
|
||||
headerStyle: { height: headerHeight }
|
||||
} = theme;
|
||||
let height = 0;
|
||||
if (!props.removeHeader) {
|
||||
height += headerHeight;
|
||||
}
|
||||
if (!props.removeTab && visible) {
|
||||
height += tabHeight;
|
||||
}
|
||||
return `${height}px`;
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.space-placholder_height {
|
||||
height: v-bind(spaceHeight);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user