<template>
<div class="el-card" :class="shadow ? \'is-\' + shadow + \'-shadow\' : \'is-always-shadow\'">
<div class="el-card__header" v-if="$slots.header || header">
<slot name="header">{{ header }}</slot>
</div>
<div class="el-card__body" :style="bodyStyle">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: \'ElCard\',
props: {
header: {},
bodyStyle: {},
shadow: {
type: String
}
}
};
</script>
Attributes
| 参数 |
说明 |
类型 |
可选值 |
默认值 |
| header |
设置 header,也可以通过 slot#header 传入 DOM |
string |
— |
— |
| body-style |
设置 body 的样式 |
object |
— |
{ padding: \'20px\' } |
| shadow |
设置阴影显示时机 |
string |
always / hover / never |
always |