mirror of https://github.com/ElemeFE/element
card: add shadow validator
parent
f14b5ba540
commit
f465223c66
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="el-card" :class="shadow ? 'is-' + shadow + '-shadow' : 'is-always-shadow'">
|
<div class="el-card" :class="shadow ? 'is-' + shadow + '-shadow' : ''">
|
||||||
<div class="el-card__header" v-if="$slots.header || header">
|
<div class="el-card__header" v-if="$slots.header || header">
|
||||||
<slot name="header">{{ header }}</slot>
|
<slot name="header">{{ header }}</slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,11 @@
|
||||||
header: {},
|
header: {},
|
||||||
bodyStyle: {},
|
bodyStyle: {},
|
||||||
shadow: {
|
shadow: {
|
||||||
type: String
|
type: String,
|
||||||
|
default: 'always',
|
||||||
|
validator(val) {
|
||||||
|
return ['always', 'hover', 'never'].includes(val)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue