UnisKB/ui/src/components/content-container/LayoutContent.vue

49 lines
1.1 KiB
Vue
Raw Normal View History

2023-10-18 11:06:22 +00:00
<template>
2023-10-19 10:18:45 +00:00
<div class="content-container">
<div class="content-container__header mb-10" v-if="slots.header || header">
<slot name="header">
2023-10-27 09:49:06 +00:00
<back-button :to="backTo" v-if="showBack"></back-button>
<span class="vertical-middle">{{ header }}</span>
2023-10-19 10:18:45 +00:00
</slot>
</div>
<el-scrollbar>
2023-10-25 10:35:28 +00:00
<div class="content-container__main main-calc-height">
2023-10-18 11:06:22 +00:00
<slot></slot>
</div>
2023-10-19 10:18:45 +00:00
</el-scrollbar>
</div>
2023-10-18 11:06:22 +00:00
</template>
<script setup lang="ts">
2023-10-27 09:49:06 +00:00
import { computed, useSlots } from 'vue'
2023-10-18 11:06:22 +00:00
defineOptions({ name: 'LayoutContent' })
const slots = useSlots()
2023-10-27 09:49:06 +00:00
const props = defineProps({
header: String,
backTo: String
})
const showBack = computed(() => {
const { backTo } = props
return backTo
2023-10-18 11:06:22 +00:00
})
</script>
<style lang="scss" scope>
.content-container {
transition: 0.3s;
2023-10-25 10:35:28 +00:00
padding: var(--app-view-padding);
2023-10-18 11:06:22 +00:00
.content-container__header {
font-weight: 600;
font-size: 18px;
box-sizing: border-box;
}
.content-container__main {
background-color: var(--app-view-bg-color);
border-radius: 6px;
box-sizing: border-box;
2023-10-19 10:18:45 +00:00
// overflow: auto;
// height: 100%;
2023-10-18 11:06:22 +00:00
}
}
</style>