UNPKG

vue-hooks-plus

Version:
24 lines (23 loc) 544 B
import { isRef } from "vue"; import isBrowser from "./isBrowser"; function getTargetElement(target, defaultElement) { var _a, _b; if (!isBrowser) { return void 0; } if (!target) { return defaultElement; } let targetElement; if (typeof target === "function") { targetElement = target(); } else if (isRef(target)) { targetElement = (_b = (_a = target.value) == null ? void 0 : _a.$el) != null ? _b : target.value; } else { targetElement = target; } return targetElement; } export { getTargetElement };