@rebilly/framepay-vue 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/build.js +36 -9
  2. package/package.json +1 -1
package/dist/build.js CHANGED
@@ -481,15 +481,24 @@ var BaseElementMixin = {
481
481
  throw new MountError();
482
482
  }
483
483
  });
484
+ },
485
+ destroyElement: function destroyElement() {
486
+ if (this.element) {
487
+ this.element.destroy();
488
+ }
484
489
  }
485
490
  },
486
491
  created: function created() {
487
492
  this.mountElement("#".concat(this.mountId));
488
493
  },
494
+ // in vue 2 beforeDestroy is emitted but not in vue 3
489
495
  beforeDestroy: function beforeDestroy() {
490
- if (this.element) {
491
- this.element.destroy();
492
- }
496
+ this.destroyElement();
497
+ },
498
+ // in vue 3 beforeDestroy hook is replaced with beforeUnmount,
499
+ // we should keep both of them for compatibility purpose
500
+ beforeUnmount: function beforeUnmount() {
501
+ this.destroyElement();
493
502
  }
494
503
  };
495
504
 
@@ -556,6 +565,11 @@ var GooglePayMixin = {
556
565
  });
557
566
  }
558
567
  });
568
+ },
569
+ destroyElement: function destroyElement() {
570
+ if (this.element) {
571
+ this.element.destroy();
572
+ }
559
573
  }
560
574
  },
561
575
  watch: {
@@ -568,10 +582,14 @@ var GooglePayMixin = {
568
582
  created: function created() {
569
583
  this.mountElement("#".concat(this.mountId));
570
584
  },
585
+ // in vue 2 beforeDestroy is emitted but not in vue 3
571
586
  beforeDestroy: function beforeDestroy() {
572
- if (this.element) {
573
- this.element.destroy();
574
- }
587
+ this.destroyElement();
588
+ },
589
+ // in vue 3 beforeDestroy hook is replaced with beforeUnmount,
590
+ // we should keep both of them for compatibility purpose
591
+ beforeUnmount: function beforeUnmount() {
592
+ this.destroyElement();
575
593
  }
576
594
  };
577
595
 
@@ -625,6 +643,11 @@ var NonIframeElementMixin = {
625
643
  });
626
644
  }
627
645
  });
646
+ },
647
+ destroyElement: function destroyElement() {
648
+ if (this.element) {
649
+ this.element.destroy();
650
+ }
628
651
  }
629
652
  },
630
653
  watch: {
@@ -637,10 +660,14 @@ var NonIframeElementMixin = {
637
660
  created: function created() {
638
661
  this.mountElement("#".concat(this.mountId));
639
662
  },
663
+ // in vue 2 beforeDestroy is emitted but not in vue 3
640
664
  beforeDestroy: function beforeDestroy() {
641
- if (this.element) {
642
- this.element.destroy();
643
- }
665
+ this.destroyElement();
666
+ },
667
+ // in vue 3 beforeDestroy hook is replaced with beforeUnmount,
668
+ // we should keep both of them for compatibility purpose
669
+ beforeUnmount: function beforeUnmount() {
670
+ this.destroyElement();
644
671
  }
645
672
  };
646
673
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/framepay-vue",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Official Vue wrapper for Rebilly FramePay",
5
5
  "author": "Rebilly",
6
6
  "repository": "https://github.com/Rebilly/framepay-vue",