whychdw
2021-06-18 da664b75ddac09ef2f810c1331cbc033ce3edf3f
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<template>
    <div class="flex-box">
        <div class="flex-box-border border-top-left"></div>
        <div class="flex-box-border border-top-right"></div>
        <div class="flex-box-border border-bottom-left"></div>
        <div class="flex-box-border border-bottom-right"></div>
        <div class="flex-box-header" v-if="!noHeader" :class="{'no-header-bg':noHeaderBg}">
            <flex-layout direction="row" no-bg>
                <div slot="header">
                    <i class="iconfont el-icon-fold"></i>
                    <span class="header-text">{{ title }}</span>
                </div>
                <div class="flex-header-tools">
                    <slot name="tools"></slot>
                </div>
            </flex-layout>
 
 
        </div>
        <div class="flex-box-body">
            <slot></slot>
        </div>
        <div class="flex-box-footer">
            <slot name="footer"></slot>
        </div>
    </div>
</template>
 
<script>
export default {
    name: "FlexBox",
    props: {
        title: {
            type: String,
            default: "",
        },
        noHeader: {
            type: Boolean,
            default: false,
        },
        noHeaderBg: {
            type: Boolean,
            default: false
        },
    },
}
</script>
 
<style scoped>
.flex-box {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}
 
.flex-box-border {
    position: absolute;
    display: inline-block;
    z-index: 9;
}
 
.flex-box-border.border-top-left {
    top: 0;
    left: 0;
    border-top: 2px solid #00FEFF;
    border-left: 2px solid #00FEFF;
}
 
.flex-box-border.border-top-right {
    top: 0;
    right: 0;
    border-top: 2px solid #00FEFF;
    border-right: 2px solid #00FEFF;
}
 
.flex-box-border.border-bottom-left {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid #00FEFF;
    border-left: 2px solid #00FEFF;
}
 
.flex-box-border.border-bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid #00FEFF;
    border-right: 2px solid #00FEFF;
}
 
.flex-box-header {
    position: relative;
    padding: 12px 0;
    font-size: 14px;
    color: #00fefe;
    font-weight: bold;
}
 
.flex-box-header.no-header-bg {
    background: none;
    padding: 8px 0;
}
 
.flex-header-tools {
    position: absolute;
    top: 8px;
    right: 16px;
    z-index: 9;
}
 
.flex-box-header .iconfont {
    font-size: 10px;
    margin-right: 8px;
    margin-left: 16px;
    transform: rotate(90deg);
}
 
.header-text {
    font-weight: bold;
}
 
.flex-box-body {
    position: relative;
    flex: 1;
    overflow: hidden;
    box-sizing: border-box;
}
</style>