layui-vue/es/pageHeader/index.js
2022-12-12 09:08:28 +08:00

46 lines
2.5 KiB
JavaScript

import { c as convertSlotName, w as withInstall } from "../badge/index2.js";
import { defineComponent, useSlots, getCurrentInstance, openBlock, createElementBlock, createElementVNode, renderSlot, unref, normalizeClass, toDisplayString, Fragment, createTextVNode } from "vue";
var index = /* @__PURE__ */ (() => '.lay-page-header{display:flex;line-height:24px}.lay-page-header__left{display:flex;cursor:pointer;margin-right:40px;position:relative;color:var(--global-neutral-color-8)}.lay-page-header__left:after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;transform:translateY(-50%);background-color:var(--global-neutral-color-8)}.lay-page-header__left:hover .layui-icon-return,.lay-page-header__left:hover .lay-page-header__title{color:var(--global-checked-color)!important}.lay-page-header__left .layui-icon-return{font-size:14px;margin-right:6px;align-self:center}.lay-page-header__title{font-size:14px}.lay-page-header__content{font-size:18px;color:#393d49}\n')();
const _hoisted_1 = { class: "lay-page-header" };
const _hoisted_2 = { class: "lay-page-header__title" };
const _hoisted_3 = { class: "lay-page-header__content" };
const __default__ = {
name: "LayPageHeader"
};
const _sfc_main = defineComponent({
...__default__,
props: {
content: { default: "" },
backText: { default: "\u8FD4\u56DE" },
backIcon: { default: "layui-icon-return" }
},
emits: ["back"],
setup(__props, { emit: emits }) {
const slots = useSlots();
const instance = getCurrentInstance();
const backIconSlotName = convertSlotName(instance, "backIcon");
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
createElementVNode("div", {
class: "lay-page-header__left",
onClick: _cache[0] || (_cache[0] = ($event) => emits("back"))
}, [
renderSlot(_ctx.$slots, unref(backIconSlotName), {}, () => [
createElementVNode("i", {
class: normalizeClass(["layui-icon", [__props.backIcon]])
}, null, 2)
]),
createElementVNode("div", _hoisted_2, toDisplayString(__props.backText), 1)
]),
createElementVNode("div", _hoisted_3, [
unref(slots).default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString(__props.content), 1)
], 64))
])
]);
};
}
});
const component = withInstall(_sfc_main);
export { component as default };