Bug will appear when the vue shopping cart animation is triggered repeatedly.

using vue to animate the shopping cart, I made a simplified version of demo : https://codepen.io/jacktown/pen/JwWPrx

to describe the problem. balls in

data is the corresponding data of div that is used to realize animation. Use v-show to switch between showing and hiding, and use the hook of js to set transform to realize animation.

what I want to achieve is to add an animation task to tasks each time the button is clicked, and execute the new animation as soon as there are free squares. But now, if you click to add more animation tasks before the previous animation is finished, the subsequent animation will not be executed correctly (the circle that should have performed the animation just stays in place. Instead of re-entering from the right).


solved, put the execution of the new animation ( this.doTask (); ) in the afterLeave hook function, then the previous animation should be really finished:

    afterEnter (ball) {
      ball.isShow = false;
      this.usedBalls.shift();
    },
    afterLeave (ball) {
      this.doTask();
    }
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37e2f-2c0c2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37e2f-2c0c2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?