UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

41 lines (37 loc) 1.21 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { i as isFunction_1 } from '../../_chunks/dep-1cc1c24f.mjs'; import { i as isString_1 } from '../../_chunks/dep-11fa9c2c.mjs'; import '../../_chunks/dep-10a947a6.mjs'; import '../../_chunks/dep-b75d8d74.mjs'; import '../../_chunks/dep-82805301.mjs'; import '../../_chunks/dep-6ad18815.mjs'; import '../../_chunks/dep-a95026f2.mjs'; import '../../_chunks/dep-068e912d.mjs'; import '../../_chunks/dep-addc2a84.mjs'; function getTargetElm(elm) { if (elm) { var _process; var targetElement = null; if (isString_1(elm)) { targetElement = document.querySelector(elm); } else if (isFunction_1(elm)) { targetElement = elm(); } else { throw new Error("elm should be string or function"); } if (targetElement) { return targetElement; } if (((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) !== "test") { throw new Error("There is no element with given."); } } else { return document.body; } } export { getTargetElm as default }; //# sourceMappingURL=getTargetElm.mjs.map