UNPKG

@vue-widget/hooks

Version:

hooks from react to vue

19 lines (18 loc) 414 B
import { isFunction } from "./index"; import isBrowser from "./isBrowser"; export function getTargetElement(target, defaultElement) { if (!isBrowser) { return undefined; } if (!target) { return defaultElement; } var targetElement; if (isFunction(target)) { targetElement = target(); } else { targetElement = target; } return targetElement; }