element-plus
Version:
A Component Library for Vue 3
17 lines (15 loc) • 403 B
JavaScript
import { isClient } from "../browser.mjs";
import { isString } from "../types.mjs";
//#region ../../packages/utils/dom/element.ts
const getElement = ((target) => {
if (!isClient || target === "") return null;
if (isString(target)) try {
return document.querySelector(target);
} catch {
return null;
}
return target;
});
//#endregion
export { getElement };
//# sourceMappingURL=element.mjs.map