emis-frontend/src/components/CardWithHeader/index.vue
2024-02-22 11:05:35 +08:00

70 lines
1.5 KiB
Vue

<template>
<div>
<!-- { height: height } -->
<el-card shadow="hover" :style="{ height: height }" v-if="isLinearBg == 'true'" class="home-card linear-background">
<div class="header">
<span>{{ header }}</span>
<slot name="header-r" />
</div>
<div>
<slot name="body" />
</div>
</el-card>
<el-card shadow="hover" :style="{ height: height }" v-else class="home-card">
<div class="header">
<span>{{ header }}</span>
<slot name="header-r" />
</div>
<div>
<slot name="body" />
</div>
</el-card>
</div>
</template>
<script>
export default {
name: 'CardWithHeader',
props: {
header: {type:String},
height: {type:String},
isLinearBg : {type:String},
}
}
</script>
<style scoped lang="scss">
.linear-background {
background-image: linear-gradient(180deg,#e8f5ff,#fff 66%,#fff 0);
}
.home-card {
.header {
span {
position: relative;
font-size: 15px;
font-weight: 500;
margin-left: 18px;
&::before {
position: absolute;
top: 2px;
left: -13px;
width: 3px;
height: 14px;
content: '';
background: #B12D29;
// background: #409EFF;
border-radius: 2px;
}
}
}
div:nth-child(2) {
margin-top: 8px;
}
}
</style>