UNPKG

@opensig/opendesign

Version:

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