Files
sionrui/frontend/app/web-gold/src/layouts/components/FullWidthLayout.vue

87 lines
1.6 KiB
Vue
Raw Normal View History

2026-01-17 19:33:59 +08:00
<script setup>
import { ArrowLeftOutlined } from '@ant-design/icons-vue'
import LayoutHeader from './LayoutHeader.vue'
2026-01-17 19:33:59 +08:00
defineOptions({ name: 'FullWidthLayout' })
// Props
const props = defineProps({
showBack: {
type: Boolean,
default: false
},
showPadding: {
type: Boolean,
default: true
2026-02-11 00:39:16 +08:00
},
headerGhost: {
type: Boolean,
default: false
},
headerPadding: {
type: String,
default: undefined
2026-01-17 19:33:59 +08:00
}
})
// Emits
const emit = defineEmits(['back'])
// Methods
const handleBack = () => {
emit('back')
}
</script>
<template>
<div class="full-width-layout">
<div v-if="$slots.header || showBack" class="full-width-layout__header-wrapper">
<LayoutHeader
:show-back="showBack"
2026-02-11 00:39:16 +08:00
:ghost="headerGhost"
:padding="headerPadding"
@back="handleBack"
>
<template #header v-if="$slots.header">
<slot name="header"></slot>
</template>
<template #extra>
<slot name="extra"></slot>
</template>
</LayoutHeader>
2026-01-17 19:33:59 +08:00
</div>
2026-01-17 19:33:59 +08:00
<!-- 全宽内容 -->
<div
class="full-width-layout__content"
:class="{ 'no-padding': !showPadding }"
>
<slot></slot>
</div>
</div>
</template>
<style scoped lang="less">
.full-width-layout {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
2026-02-25 23:44:01 +08:00
background: var(--color-bg-card);
2026-01-17 19:33:59 +08:00
}
.full-width-layout__header-wrapper {
2026-01-17 19:33:59 +08:00
flex-shrink: 0;
}
.full-width-layout__content {
flex: 1;
overflow: auto;
2026-01-17 19:54:57 +08:00
background: var(--color-bg);
2026-01-17 19:33:59 +08:00
&.no-padding {
padding: 0;
}
}
</style>