cardWarp.vue 1.48 KB
Newer Older
xiexingan's avatar
xiexingan committed
1 2
<template lang='pug'>
.card-warp
3
    .card-header(:style="{height,'line-height':height}" :class=" showBackground ? 'bg' : '' ")
xiexingan's avatar
xiexingan committed
4
        span.card-title {{ title }}
xiexingan's avatar
xiexingan committed
5 6
            div(style='margin-left:20px;')
                slot(name="left" )
xiexingan's avatar
xiexingan committed
7 8 9 10 11 12 13 14 15 16 17 18
        slot(name="right")
    .card-content
        slot(name="content")
</template>

<script>
export default {
    name: 'card-warp',
    props: {
        title: {
            type: String,
            default: '数据统计'
19 20 21 22 23 24 25
        },
        height: {
            type: String,
            default: '74px'
        },
        showBackground: {
            type: Boolean,
xiexingan's avatar
xiexingan committed
26
            default: true
xiexingan's avatar
xiexingan committed
27 28 29 30 31 32 33 34 35 36 37
        }
    }
}
</script>
<style lang="scss" scoped>
.card-warp {
    width: 100%;
    height: 100%;
    .card-header {
        display: flex;
        justify-content: space-between;
38 39
        // height: 74px;
        // line-height: 74px;
xiexingan's avatar
xiexingan committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
        padding: 0 20px;
        border-bottom: 1px solid #ececec;
        .card-title {
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 16px;
            font-weight: 600;
            &::before {
                content: "";
                display: inline-block;
                padding-right: 5px;
                margin-right: 10px;
                height: 16px;

                background: #21acfc;
            }
        }
    }
    .card-content {
        margin: 20px;
61
        height: calc(100% - 100px);
xiexingan's avatar
xiexingan committed
62 63
    }
}
64 65 66
.bg{
    background: #F2FAFF;
}
xiexingan's avatar
xiexingan committed
67
</style>