layui-vue/es/card/index.js

62 lines
2.7 KiB
JavaScript
Raw Normal View History

2022-11-14 03:59:26 +00:00
import { w as withInstall } from "../badge/index2.js";
import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
var index = /* @__PURE__ */ (() => ":root{--card-border-radius: var(--global-border-radius)}.layui-card{margin-bottom:15px;background-color:#fff;border-radius:var(--card-border-radius)}.layui-card .layui-card-header{height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;font-size:14px}.layui-card .layui-card-footer{height:42px;line-height:42px;padding:0 15px;border-top:1px solid #f6f6f6;font-size:14px}.layui-card .layui-card-header .layui-card-header-extra{float:right}.layui-card .layui-card-body{padding:10px 15px;line-height:24px}.layui-card:last-child{margin-bottom:0}.layui-card.is-hover-shadow:hover,.layui-card.shadow{box-shadow:0 1px 2px #0000000d}\n")();
const _hoisted_1 = {
key: 0,
class: "layui-card-header"
};
const _hoisted_2 = { class: "layui-card-header-title" };
const _hoisted_3 = {
key: 0,
class: "layui-card-header-extra"
};
const _hoisted_4 = { class: "layui-card-body" };
const _hoisted_5 = {
key: 1,
class: "layui-card-footer"
};
const __default__ = {
name: "LayCard"
};
const _sfc_main = defineComponent({
...__default__,
props: {
title: null,
shadow: { default: "always" }
},
setup(__props) {
const props = __props;
const slots = useSlots();
const classes = computed(() => {
return {
shadow: props.shadow === "always",
"is-hover-shadow": props.shadow === "hover"
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-card", unref(classes)])
}, [
unref(slots).title || __props.title || unref(slots).extra ? (openBlock(), createElementBlock("div", _hoisted_1, [
createElementVNode("span", _hoisted_2, [
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString(__props.title), 1)
])
]),
unref(slots).extra ? (openBlock(), createElementBlock("span", _hoisted_3, [
renderSlot(_ctx.$slots, "extra")
])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
createElementVNode("div", _hoisted_4, [
unref(slots).body ? renderSlot(_ctx.$slots, "body", { key: 0 }) : renderSlot(_ctx.$slots, "default", { key: 1 })
]),
unref(slots).footer ? (openBlock(), createElementBlock("div", _hoisted_5, [
renderSlot(_ctx.$slots, "footer")
])) : createCommentVNode("", true)
], 2);
};
}
});
const component = withInstall(_sfc_main);
export { component as default };