wujingjing
2025-04-14 1df71bdd7fc5b35be1447c9cc574bf610666f436
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!-- 布局容器,由 aside、main 组成 -->
<template>
    <el-row :gutter="8" class="h-full">
        <el-col :span="4" :xs="24" class="h100">
            <el-card class="yw-layout-card h100" v-if="type === 'card'" shadow="hover">
                <slot name="aside"> </slot>
            </el-card>
            <slot v-else name="aside"></slot>
        </el-col>
        <el-col :span="20" :xs="24" class="flex-column h100">
            <el-card class="yw-layout-card yw-layout-main flex-auto" v-if="type === 'card'" shadow="hover" style="margin-top: 8ppx">
                <slot name="main"> </slot>
            </el-card>
            <slot v-else name="main"> </slot>
            <slot> </slot>
        </el-col>
    </el-row>
</template>
 
<script setup lang="ts">
import type { PropType } from 'vue';
 
const props = defineProps({
    type: {
        type: String as PropType<'card' | 'default'>,
        default: 'default',
    },
});
</script>
<style scoped lang="scss">
.yw-layout-card.el-card {
    > :deep(.el-card__body) {
        height: 100%;
    }
}
</style>