whychdw
2020-08-18 bcf3980c538b7c8b3d913e64092bc874daed3abf
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
<template>
    <div class="content-box" :class="{'no-border': noborder}">
        <div class="content-box-title" :class="getTitlePos">
            <slot name="title">{{title}}</slot>
        </div>
        <div class="content-box-content">
            <slot></slot>
        </div>
        <div class="content-box-footer">
            <slot name="footer"></slot>
        </div>
    </div>
</template>
 
<script>
export default {
    name: 'contentBox',
    props: {
        titleLeft: {
            type: Boolean,
            default: false
        },
        title: {
            type: String,
            default: '头部信息'
        },
        noborder: {
            type: Boolean,
            default: false
        },
    },
    computed: {
        getTitlePos: function() {
            return this.titleLeft?'txt-left': '';
        }
    },
    mounted(){
        //console.log(this.titleLeft);
    }
}
</script>
 
<style scoped>
.content-box {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    font-size: 16px;
}
.content-box.no-border {
    border: none;
}
.content-box-title {
    margin-top: 4px;
    margin-left: 4px;
    margin-right: 4px;
    padding-left: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    background-image: linear-gradient(rgb(62, 189, 201), #016A95,#00638D, #006999, #009EE3);
    line-height: 32px;
    font-weight: bold;
}
.content-box-title.txt-left {
    text-align: left;
}
.content-box-content {
    flex: 1;
    margin-top: 4px;
    margin-left: 4px;
    margin-right: 4px;
    overflow-y: auto;
}
.footer .content-box-content {
    bottom: 32px;
}
.content-box-footer {
    margin-left: 4px;
    margin-right: 4px;
    padding-left: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    line-height: 32px;
    font-weight: bold;
}
</style>