element.mjs 423 B

1234567891011121314151617181920
  1. import '../types.mjs';
  2. import '../browser.mjs';
  3. import { isClient } from '@vueuse/core';
  4. import { isString } from '@vue/shared';
  5. const getElement = (target) => {
  6. if (!isClient || target === "")
  7. return null;
  8. if (isString(target)) {
  9. try {
  10. return document.querySelector(target);
  11. } catch (e) {
  12. return null;
  13. }
  14. }
  15. return target;
  16. };
  17. export { getElement };
  18. //# sourceMappingURL=element.mjs.map