element-plus
Version:
A Component Library for Vue3.0
57 lines (50 loc) • 1.49 kB
JavaScript
import { defineComponent, openBlock, createBlock, createVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
var script = defineComponent({
name: 'ElCard',
props: {
header: {
type: String,
default: '',
},
bodyStyle: {
type: [String, Object, Array],
default: '',
},
shadow: {
type: String,
default: '',
},
},
});
const _hoisted_1 = {
key: 0,
class: "el-card__header"
};
function render(_ctx, _cache, $props, $setup, $data, $options) {
return (openBlock(), createBlock("div", null, [
createVNode("div", {
class: ["el-card", _ctx.shadow ? 'is-' + _ctx.shadow + '-shadow' : 'is-always-shadow']
}, [
(_ctx.$slots.header || _ctx.header)
? (openBlock(), createBlock("div", _hoisted_1, [
renderSlot(_ctx.$slots, "header", {}, () => [
createTextVNode(toDisplayString(_ctx.header), 1 /* TEXT */)
])
]))
: createCommentVNode("v-if", true),
createVNode("div", {
class: "el-card__body",
style: _ctx.bodyStyle
}, [
renderSlot(_ctx.$slots, "default")
], 4 /* STYLE */)
], 2 /* CLASS */)
]))
}
script.render = render;
script.__file = "packages/card/src/index.vue";
script.install = (app) => {
app.component(script.name, script);
};
const _Card = script;
export default _Card;