UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

32 lines (28 loc) 942 B
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { getCurrentInstance, h, createVNode } from 'vue'; import { i as isFunction_1 } from '../_chunks/dep-1cc1c24f.mjs'; import '../_chunks/dep-10a947a6.mjs'; import '../_chunks/dep-b75d8d74.mjs'; import '../_chunks/dep-82805301.mjs'; import '../_chunks/dep-6ad18815.mjs'; function useIcon() { var instance = getCurrentInstance(); return function renderIconTNode(iconType, defaultIcons) { var iconContent; if (isFunction_1(instance.props[iconType])) { iconContent = instance.props[iconType](h); } else if (instance.slots[iconType]) { iconContent = instance.slots[iconType] && instance.slots[iconType](null)[0]; } else if (defaultIcons) { var Component = defaultIcons[instance.props.theme]; iconContent = createVNode(Component, null, null); } return iconContent; }; } export { useIcon }; //# sourceMappingURL=icon.mjs.map