<template>
    <div class="zr-card" :class="[align?'zr-card--column':'zr-card--row',{'radius':radius}]" :style="{width, height}">
        <div class="img">
            <slot name="img" ></slot>
        </div>
        <div class="content-footer">
            <div class="zr-card-content" :class="{'space':!header}">
                <slot name="content"></slot>
            </div>
            <div class="zr-card-footer" v-if="footer">
                <slot name="footer"></slot>
            </div>
        </div>
        
    </div>
    
</template>

<script>
export default {
    props: {
        backgroundColor: {
            type: String,
            default: "#FFFFFF",
        },
        color: {
            type: String,
            default: "",
        },
        radius: {
            type: Boolean,
            default: true,
        },
        align: {
            type: Boolean,
            default: true,  // row：横向 column：纵向
        },
        header: {
            type: Boolean,
            default: true,
        },
        footer: {
            type: Boolean,
            default: true,
        },
        width: {
            type: String,
            default: '260px',
        },
        height: {
            type: String,
            default: 'auto',
        }
    },
    data() {
        return {};
    },
    methods: {},
};
</script>

<style lang="less" scoped>
.zr-pic-card-list {
    display: flex;
    height: auto;
}
.zr-card {
    display: flex;
    height: auto;
    color: #333;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    .zr-card-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 14px;
        line-height: 40px;
        padding: 10px 20px;
        .zr-card-top-title {
            font-size: 16px;
            font-weight: normal;
            .icon {
                position: relative;
                top: -1px;
                font-size: 18px;
            }
        }
    }
    .content-footer {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    .zr-card-content {
        padding: 10px 12px;
        flex: 1;    
    }
    .space {
        padding: 20px;
    }
    .zr-card-footer {
        width: 100%;
        min-height: 42px;
        border-top: 1px solid #eaeaea;
    }
}
.zr-card--column {
    flex-direction: column;
}
.zr-card--row {
    flex-direction: row;
}
.radius {
    border-radius: 6px;
    overflow: hidden;
}



</style>