UNPKG

tdesign-mobile-vue

Version:
36 lines (28 loc) 1.02 kB
/** * tdesign v1.7.0 * (c) 2024 TDesign Group * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var isFunction = require('lodash/isFunction'); var vue = require('vue'); 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 = Component; } return iconContent; }; } exports.useIcon = useIcon; //# sourceMappingURL=icon.js.map