element.js 517 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. require('../types.js');
  4. require('../browser.js');
  5. var core = require('@vueuse/core');
  6. var shared = require('@vue/shared');
  7. const getElement = (target) => {
  8. if (!core.isClient || target === "")
  9. return null;
  10. if (shared.isString(target)) {
  11. try {
  12. return document.querySelector(target);
  13. } catch (e) {
  14. return null;
  15. }
  16. }
  17. return target;
  18. };
  19. exports.getElement = getElement;
  20. //# sourceMappingURL=element.js.map