whychdw
2020-10-20 625ac433830bf7557a8197b05ce6242e80f8f6df
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
<template>
    <div class="chart-wrapper">
        <div class="chart-wrapper-corner top-right"></div>
        <div class="chart-wrapper-corner bottom-right"></div>
        <div class="chart-wrapper-title">
            <span class="title-icon">
                <span class="title-icon-content"></span>
            </span>
            {{title}}
        </div>
        <slot></slot>
    </div>
</template>
 
<script>
export default {
    name: "ChartWrapper",
    props:{
        title: {
            type: String,
            default: '未知内容'
        },
    }
}
</script>
 
<style scoped>
.chart-wrapper {
    position: relative;
    box-sizing: border-box;
    height: 100%;
    background-image: radial-gradient(#151f4140, #3667ec40);
}
.chart-wrapper-title {
    position: absolute;
    top: 16px;
    left: 16px;
    color: #00feff;
    font-size: 14px;
    font-weight: bold;
}
.title-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
}
.title-icon:before,
.title-icon:after,
.title-icon-content{
    display: inline-block;
    content: "";
    width: 4px;
    vertical-align: middle;
}
 
.title-icon:before {
    height: 14px;
    background-color: #0f448d;
}
.title-icon-content {
    margin-left: 4px;
    height: 18px;
    background-color: #1e77b8;
}
.title-icon:after {
    margin-left: 4px;
    height: 22px;
    background-color: #2cabe3;
}
.chart-wrapper:before,
.chart-wrapper:after,
.chart-wrapper-corner {
    position: absolute;
    display: inline-block;
    content: " ";
    width: 16px;
    height: 16px;
}
.chart-wrapper:before {
    left: 0;
    top: 0;
    border-top: 2px solid #00FEFF;
    border-left: 2px solid #00FEFF;
}
.chart-wrapper:after {
    left: 0;
    bottom: 0;
    border-bottom: 2px solid #00FEFF;
    border-left: 2px solid #00FEFF;
}
.chart-wrapper-corner.top-right {
    top: 0;
    right: 0;
    border-top: 2px solid #00FEFF;
    border-right: 2px solid #00FEFF;
}
.chart-wrapper-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid #00FEFF;
    border-right: 2px solid #00FEFF;
}
</style>