he wei
2021-11-02 4964aa7f82cf72c08cb1cf357b975d0122d73e5e
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
    <div class="flex-layout" :class=getRootClass :style="getRootStyle">
        <div class="flex-layout-header">
            <slot name="header"></slot>
        </div>
        <div class="flex-layout-body" :class="{'no-bg': noBg}">
            <slot></slot>
        </div>
        <div class="flex-layout-footer">
            <slot name="footer"></slot>
        </div>
    </div>
</template>
 
<script>
export default {
    props: {
        direction: {
            type: String,
            default: '',
        },
        height: {
            type: String,
            default: "100%",
        },
        noBg: {
            type: Boolean,
            default: false
        }
    },
    computed: {
        getRootClass: function() {
            return {
               'direction-row':  this.direction == 'row'?true: false
            };
        },
        getRootStyle: function() {
            return {
                'height': this.height,
            }
        },
    }
}
</script>
 
<style scoped>
.flex-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.flex-layout.direction-row {
    flex-direction: row;
}
.flex-layout.full-ht {
    height: 100%;
}
 
.flex-layout-body {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
}
.flex-layout-body.no-bg {
    background-color: #05227200;
}
</style>