UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

36 lines (28 loc) 1.05 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var isFunction = require('lodash/isFunction'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var isFunction__default = /*#__PURE__*/_interopDefaultLegacy(isFunction); function useIcon() { var instance = vue.getCurrentInstance(); return function renderIconTNode(iconType, defaultIcons) { var iconContent; if (isFunction__default["default"](instance.props[iconType])) { iconContent = instance.props[iconType](vue.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 = vue.createVNode(Component, null, null); } return iconContent; }; } exports.useIcon = useIcon; //# sourceMappingURL=icon.js.map