VciFadeFlow.js 535 B

12345678910111213141516171819202122232425262728
  1. import "./index.scss";
  2. export default {
  3. name: "VciFadeFlow",
  4. props: {
  5. direction: {
  6. type: String,
  7. default: "ltr"
  8. }
  9. },
  10. mounted() {
  11. const cls = `vci-amt-fade-flow-${this.direction}`;
  12. this.$el.addEventListener(
  13. "animationend",
  14. () => {
  15. this.$el.classList.remove(cls);
  16. this.$emit("complete");
  17. },
  18. {
  19. once: true
  20. }
  21. );
  22. this.$el.classList.add(cls);
  23. },
  24. render() {
  25. return this.$scopedSlots.default ? this.$scopedSlots.default() : null;
  26. }
  27. };