dom.js 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, transform, transition, on, off, trigger, transitionEnd, outerWidth, outerHeight, styles, offset, css, each, html, text, is, index, eq, append, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, filter, remove } from 'dom7';
  2. const Methods = {
  3. addClass,
  4. removeClass,
  5. hasClass,
  6. toggleClass,
  7. attr,
  8. removeAttr,
  9. transform,
  10. transition,
  11. on,
  12. off,
  13. trigger,
  14. transitionEnd,
  15. outerWidth,
  16. outerHeight,
  17. styles,
  18. offset,
  19. css,
  20. each,
  21. html,
  22. text,
  23. is,
  24. index,
  25. eq,
  26. append,
  27. prepend,
  28. next,
  29. nextAll,
  30. prev,
  31. prevAll,
  32. parent,
  33. parents,
  34. closest,
  35. find,
  36. children,
  37. filter,
  38. remove
  39. };
  40. Object.keys(Methods).forEach(methodName => {
  41. Object.defineProperty($.fn, methodName, {
  42. value: Methods[methodName],
  43. writable: true
  44. });
  45. });
  46. export default $;