mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-14 09:26:34 +08:00
50 lines
1.1 KiB
Vue
50 lines
1.1 KiB
Vue
<template>
|
|
<div>
|
|
<el-card :style="{ height: height }" class="home-card">
|
|
<div class="header">
|
|
<span class="header-span">{{ header }}</span>
|
|
<slot name="header-l" />
|
|
<slot name="header-r" />
|
|
</div>
|
|
|
|
<div>
|
|
<slot name="body" />
|
|
</div>
|
|
</el-card>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineOptions({ name: 'CardWithHeader' });
|
|
defineProps({
|
|
header: String,
|
|
height: String,
|
|
});
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.home-card {
|
|
.header {
|
|
.header-span {
|
|
position: relative;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
margin-left: 18px;
|
|
&::before {
|
|
position: absolute;
|
|
top: 4px;
|
|
left: -13px;
|
|
width: 4px;
|
|
height: 14px;
|
|
content: '';
|
|
background: $primary-color;
|
|
border-radius: 10px;
|
|
}
|
|
}
|
|
}
|
|
|
|
div:nth-child(2) {
|
|
margin-top: 20px;
|
|
}
|
|
}
|
|
</style>
|