index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. const AFTER_APPEAR = "after-appear";
  5. const AFTER_ENTER = "after-enter";
  6. const AFTER_LEAVE = "after-leave";
  7. const APPEAR = "appear";
  8. const APPEAR_CANCELLED = "appear-cancelled";
  9. const BEFORE_ENTER = "before-enter";
  10. const BEFORE_LEAVE = "before-leave";
  11. const ENTER = "enter";
  12. const ENTER_CANCELLED = "enter-cancelled";
  13. const LEAVE = "leave";
  14. const LEAVE_CANCELLED = "leave-cancelled";
  15. const useTransitionFallthroughEmits = [
  16. AFTER_APPEAR,
  17. AFTER_ENTER,
  18. AFTER_LEAVE,
  19. APPEAR,
  20. APPEAR_CANCELLED,
  21. BEFORE_ENTER,
  22. BEFORE_LEAVE,
  23. ENTER,
  24. ENTER_CANCELLED,
  25. LEAVE,
  26. LEAVE_CANCELLED
  27. ];
  28. const useTransitionFallthrough = () => {
  29. const { emit } = vue.getCurrentInstance();
  30. return {
  31. onAfterAppear: () => {
  32. emit(AFTER_APPEAR);
  33. },
  34. onAfterEnter: () => {
  35. emit(AFTER_ENTER);
  36. },
  37. onAfterLeave: () => {
  38. emit(AFTER_LEAVE);
  39. },
  40. onAppearCancelled: () => {
  41. emit(APPEAR_CANCELLED);
  42. },
  43. onBeforeEnter: () => {
  44. emit(BEFORE_ENTER);
  45. },
  46. onBeforeLeave: () => {
  47. emit(BEFORE_LEAVE);
  48. },
  49. onEnter: () => {
  50. emit(ENTER);
  51. },
  52. onEnterCancelled: () => {
  53. emit(ENTER_CANCELLED);
  54. },
  55. onLeave: () => {
  56. emit(LEAVE);
  57. },
  58. onLeaveCancelled: () => {
  59. emit(LEAVE_CANCELLED);
  60. }
  61. };
  62. };
  63. exports.useTransitionFallthrough = useTransitionFallthrough;
  64. exports.useTransitionFallthroughEmits = useTransitionFallthroughEmits;
  65. //# sourceMappingURL=index.js.map