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
| <template>
| <div
| class="flex-layout"
| :class="getRootClass"
| :style="getRootStyle"
| v-loading="loading"
| element-loading-text="拼命加载中"
| element-loading-spinner="el-icon-loading"
| element-loading-background="rgba(0, 0, 0, 0.2)"
| >
| <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,
| },
| loading: {
| 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>
|
|