tdesign-vue-next
Version:
TDesign Component for vue-next
61 lines (56 loc) • 1.84 kB
JavaScript
/**
* tdesign v1.20.2
* (c) 2026 tdesign
* @license MIT
*/
;
var Vue = require('vue');
var isObject = require('./dep-2c7a67b8.js');
var isString = require('./dep-be760bc2.js');
var isArray = require('./dep-959f4847.js');
function getDefaultNode(options) {
var defaultNode;
if (isObject.isObject(options) && "defaultNode" in options) {
defaultNode = options.defaultNode;
} else if (Vue.isVNode(options) || isString.isString(options)) {
defaultNode = options;
}
return defaultNode;
}
function getChildren(content) {
var childList = [];
var _innerGetChildren = function innerGetChildren(content2) {
if (!isArray.isArray(content2)) return;
content2.forEach(function (item) {
if (item.children && isArray.isArray(item.children)) {
if (item.type !== Vue.Fragment) return;
_innerGetChildren(item.children);
} else {
childList.push(item);
}
});
return childList;
};
return _innerGetChildren(content);
}
function getParams(options) {
return isObject.isObject(options) && "params" in options ? options.params : {};
}
function getSlotFirst(options) {
return isObject.isObject(options) && "slotFirst" in options ? options.slotFirst : false;
}
function isPropsUsed(propsName) {
var _getCurrentInstance = Vue.getCurrentInstance(),
vnode = _getCurrentInstance.vnode,
slots = _getCurrentInstance.slots;
var vProps = vnode.props || {};
if (Object.prototype.hasOwnProperty.call(vProps, propsName)) return true;
if (slots && Object.prototype.hasOwnProperty.call(slots, propsName)) return true;
return false;
}
exports.getChildren = getChildren;
exports.getDefaultNode = getDefaultNode;
exports.getParams = getParams;
exports.getSlotFirst = getSlotFirst;
exports.isPropsUsed = isPropsUsed;
//# sourceMappingURL=dep-9dfd682d.js.map