4 天以前 533353dbeb19b3fa45817e9f65874db4e2ce6f9e
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
<template>
  <section class="app-panel home-panel">
    <header v-if="title || $slots.extra" class="home-panel__head">
      <div class="home-panel__title-wrap">
        <h3 class="home-panel__title">{{ title }}</h3>
        <span v-if="subtitle" class="home-panel__subtitle">{{ subtitle }}</span>
      </div>
      <div class="home-panel__extra">
        <slot name="extra"></slot>
      </div>
    </header>
    <div v-loading="loading" class="home-panel__body" :style="bodyStyle">
      <slot></slot>
    </div>
  </section>
</template>
 
<script setup>
defineProps({
  title: { type: String, default: '' },
  subtitle: { type: String, default: '' },
  loading: { type: Boolean, default: false },
  bodyStyle: { type: [String, Object], default: '' }
})
</script>
 
<style scoped>
.home-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
 
.home-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 0;
}
 
.home-panel__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
 
.home-panel__title {
  position: relative;
  margin: 0;
  padding-left: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--app-text);
}
 
.home-panel__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--app-primary);
}
 
.home-panel__subtitle {
  font-size: 12px;
  color: var(--app-text-tertiary);
}
 
.home-panel__extra {
  display: flex;
  align-items: center;
  gap: 8px;
}
 
.home-panel__body {
  flex: 1;
  min-height: 0;
  padding: 14px 16px 16px;
}
</style>