index.mjs 1.4 KB

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