UNPKG

@opensig/opendesign

Version:

<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>

41 lines (40 loc) 1.2 kB
import { defineComponent, inject, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString } from "vue"; import { dropdownInjectKey } from "./provide.mjs"; import { dropdownItemProps } from "./types.mjs"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "ODropdownItem", props: dropdownItemProps, setup(__props) { const props = __props; const dropdownInjection = inject(dropdownInjectKey, null); const onItemClick = () => { if (props.disabled) { return; } dropdownInjection == null ? void 0 : dropdownInjection.updateVisible(false); }; return (_ctx, _cache) => { return openBlock(), createElementBlock( "li", { class: normalizeClass(["o-dropdown-item", { "o-dropdown-disabled": props.disabled }]), onClick: onItemClick }, [ renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode( toDisplayString(props.label || `${props.value}`), 1 /* TEXT */ ) ]) ], 2 /* CLASS */ ); }; } }); export { _sfc_main as default };