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
| <script>
| export default {
| name: "HdwBox",
| props: {
| title: {
| type: String,
| default: '标题'
| }
| },
| data() {
| return {};
| },
| methods: {
|
| },
| mounted() {
|
| }
| }
| </script>
|
| <template>
| <div class="hdw-box-wrapper">
| <div class="hdw-box-header">
| <div class="header-title">{{ title }}</div>
| <div class="header-tools">
| <slot name="tools"></slot>
| </div>
| </div>
| <div class="hdw-box-main">
| <div class="content-relative">
| <div class="content-absolute">
| <slot></slot>
| </div>
| </div>
| </div>
| </div>
| </template>
|
| <style scoped lang="scss">
| .hdw-box-wrapper {
| display: flex;
| flex-direction: column;
| height: 100%;
| border: 1px solid var(--base-color90);
| border-radius: 8px;
| background-color: var(--bg-color);
| .hdw-box-header {
| position: relative;
| padding: 8px;
| border-bottom: 1px solid var(--base-color90);
| .header-title {
| font-weight: 700;
| }
| .header-tools {
| position: absolute;
| top: 4px;
| right: 8px;
| }
| }
| .hdw-box-main {
| flex: 1;
| }
| }
| .content-relative {
| position: relative;
| height: 100%;
| .content-absolute {
| position: absolute;
| width: 100%;
| height: 100%;
| top: 0;
| left: 0;
| right: 0;
| bottom: 0;
| }
| }
| </style>
|
|