element.mjs 375 B

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