UNPKG

@layui/layui-vue

Version:

a component library for Vue 3 base on layui-vue

12 lines (11 loc) 1.05 kB
import { defineComponent as r, inject as p, openBlock as a, createElementBlock as o, normalizeClass as f, normalizeStyle as u, createElementVNode as m, renderSlot as l, createCommentVNode as t } from "vue"; import { DROPDOWN_INJECTION_KEY as y } from "../dropdown/interface.js"; const c = { class: "layui-menu-body-title" }, x = { key: 0, class: "layui-dropdown-menu-prefix" }, b = { key: 0, class: "layui-dropdown-menu-suffix" }, N = r({ name: "LayDropdownMenuItem", __name: "index", props: { disabled: { type: Boolean, default: !1 } }, setup(n) { const i = n, s = p(y, {}), d = () => { i.disabled || s != null && s.hide && (s == null || s.hide()); }; return (e, $) => (a(), o("li", { onClick: d, class: f({ "layui-disabled": e.disabled }), style: u(e.$slots.suffix ? "justify-content: space-between;" : "") }, [m("span", c, [e.$slots.prefix ? (a(), o("span", x, [l(e.$slots, "prefix")])) : t("", !0), l(e.$slots, "default")]), e.$slots.suffix ? (a(), o("span", b, [l(e.$slots, "suffix")])) : t("", !0)], 6)); } }); export { N as default };